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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jun 05, 2021 at 12:19:32PM +0800, lijiang wrote:
> > diff --git a/diskdump.c b/diskdump.c
> > index 3effb52..c05f1ec 100644
> > --- a/diskdump.c
> > +++ b/diskdump.c
> > @@ -1146,7 +1146,7 @@ cache_page(physaddr_t paddr)
> >         if (FLAT_FORMAT()) {
> >                 if (!read_flattened_format(dd->dfd, pd.offset, dd->compressed_page, pd.size))
> >                         return READ_ERROR;
> > -       } else if (is_incomplete_dump() && (0 == pd.offset)) {
> > +       } else if (0 == pd.offset) {
> >                 /*
> >                  *  If the incomplete flag has been set in the header,
> >                  *  first check whether zero_excluded has been set.
> 
> Does it still make sense to check the incomplete flag for the
> zero_excluded case?

Hi Lianbo,

zero_excluded might still be helpful if missed page is not important and
dump analysis could be continued without it as defined in the doc:


       --zero_excluded
              If the makedumpfile(8) facility has filtered a compressed
              kdump dumpfile to exclude various types of non-essential
              pages, or has marked a compressed or ELF kdump dumpfile as
              incomplete due to an ENOSPC or other error during its
              creation, any attempt to read missing pages will fail.
              With this flag, reads from any of those pages will return
              zero-filled memory.

So, in that sense, it would work exactly as documented.

> Otherwise, the above code comment will be
> outdated.
>

Thanks for spotting outdated comment. I'll correct it in v2.

Regards
Roman

> +       } else if (0 == pd.offset) {
>                 ...
> -               if (*diskdump_flags & ZERO_EXCLUDED) {
> +              if (is_incomplete_dump() && (*diskdump_flags & ZERO_EXCLUDED)) {
> 

--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/crash-utility




[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux