Re: [PATCH 1/1] xfs_metadump: Zap more stale data

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

 



On Fri, Oct 5, 2018 at 12:23 AM Darrick J. Wong <darrick.wong@xxxxxxxxxx> wrote:
>
> On Thu, Oct 04, 2018 at 10:57:49PM +0200, Stefan Ring wrote:
> > I have empirically found and tried to fix some places where stale data was not properly zeroed out.
> >
> > In the order of the code changes:
> >
> > The "freeindex" blocks in inode directories, from last entry to end of block.
> >
> > XFS_DIR2_LEAF1_MAGIC, from last entry to end of block.
> >
> > In btree format inodes before as well as after the btree pointers.
> >
> > In dev inodes, everything after the header.
>
> Mostly looks ok, but with some style issues:
>
> > ---
> >  db/metadump.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
> >  1 file changed, 69 insertions(+), 5 deletions(-)
> >
> > diff --git a/db/metadump.c b/db/metadump.c
> > index cc2ae9af..e7159cd1 100644
> > --- a/db/metadump.c
> > +++ b/db/metadump.c
> > @@ -1421,12 +1421,42 @@ process_sf_attr(
> >               memset(asfep, 0, XFS_DFORK_ASIZE(dip, mp) - ino_attr_size);
> >  }
> >
> > +static void
> > +process_dir_free_block(
> > +     char                            *block)
> > +{
> > +     struct xfs_dir2_free            *free;
> > +     struct xfs_dir3_icfree_hdr      freehdr;
> > +
> > +     if (!zero_stale_data)
> > +             return;
> > +
> > +     free = (struct xfs_dir2_free *)block;
> > +     M_DIROPS(mp)->free_hdr_from_disk(&freehdr, free);
> > +
> > +     /* Zero out space from end of bests[] to end of block */
> > +     if (freehdr.magic == XFS_DIR2_FREE_MAGIC) {
>
> How about XFS_DIR3_FREE_MAGIC ?

Is there any documentation on DIR3? I left it out on purpose and hoped
someone would fill in the blanks for me ;).



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux