[Crash-utility] [PATCH 1/2] diskdump: Fail readmem() early if dump is incomplete

Roman Bolshakov r.bolshakov at yadro.com
Wed Jun 9 00:36:53 UTC 2021


On Wed, Jun 09, 2021 at 12:02:16AM +0000, HAGIO KAZUHITO(萩尾 一仁) wrote:
> -----Original Message-----
> > On Tue, Jun 08, 2021 at 02:40:39AM +0000, HAGIO KAZUHITO(萩尾 一仁) wrote:
> > > > Does it still make sense to check the incomplete flag for the
> > > > zero_excluded case? Otherwise, the above code comment will be
> > > > outdated.
> > > > +       } else if (0 == pd.offset) {
> > > >                 ...
> > > > -               if (*diskdump_flags & ZERO_EXCLUDED) {
> > > > +              if (is_incomplete_dump() && (*diskdump_flags & ZERO_EXCLUDED)) {
> > >
> > > Given the fact that makedumpfile cannot mark a dump as incomplete every time
> > > it fails, I think it might be good to be able to use zero_excluded option
> > > also without the incomplete flag.
> > >
> > 
> > Hi Kazu,
> > 
> > Yes, that was my thought too.
> > 
> > > So I'm ok with the original change, but additionally would like to
> > > - fix the comment Lianbo pointed out and help texts of zero_excluded
> > > - change netdump.c as well
> > >
> > 
> > I'll correct the comment. What would you want to change in netdump.c?
> 
> I thought that if we change diskdump.c to be able to use zero_excluded
> without the incomplete flag then it would be better to change netdump.c
> the same, i.e. remove this is_incomplete_dump() and fix the comment in
> read_netdump() too:
>                         /*
>                          *  If the incomplete flag has been set in the header, 
>                          *  first check whether zero_excluded has been set.
>                          */
>                         if (is_incomplete_dump() && (read_ret >= 0) &&
>                             (*diskdump_flags & ZERO_EXCLUDED)) {
> 


Thanks for pointing it out, Kazu.

I never worked with netdump and initially thought whether it somehow
related to processing of dumps over network but after inspecting the
code it seems like it processes regular files. Are the files written by
netdump-server?

I'm not sure if I have enough context and fully understand interaction
between netdump.c and netdump-server. I'll be confident to do the change
in v2 if you are sure it would work exactly as in the case of
diskdump.c/makedumpfile.

I tested my changes on a real incomplete core produced by makedumpfile
and I don't have an incomplete netdump core :)

Regards,
Roman





More information about the Crash-utility mailing list