From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Stefan Ring <stefanrin@gmail.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/1] xfs_metadump: Zap more stale data
Date: Fri, 5 Oct 2018 13:57:33 -0700 [thread overview]
Message-ID: <20181005205733.GC19324@magnolia> (raw)
In-Reply-To: <CAAxjCExSQ7Ex8U5k9_Com_89YDFGB-DE2FNGoEvO_MwFEMB_MQ@mail.gmail.com>
On Fri, Oct 05, 2018 at 10:46:28PM +0200, Stefan Ring wrote:
> On Fri, Oct 5, 2018 at 12:23 AM Darrick J. Wong <darrick.wong@oracle.com> 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 ;).
Fairly similar to DIR2, but with bigger headers, I think.
https://djwong.org/docs/kdoc/filesystems/xfs-data-structures/dynamic.html#leaf-directories
--D
next prev parent reply other threads:[~2018-10-06 3:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-04 20:57 [PATCH 0/1] Try to squash metadump data leaks Stefan Ring
2018-10-04 20:57 ` [PATCH 1/1] xfs_metadump: Zap more stale data Stefan Ring
2018-10-04 22:23 ` Darrick J. Wong
2018-10-05 20:46 ` Stefan Ring
2018-10-05 20:57 ` Darrick J. Wong [this message]
2018-10-05 20:35 ` Stefan Ring
2018-10-05 20:40 ` Darrick J. Wong
2018-10-07 9:43 ` Stefan Ring
2018-10-07 11:57 ` Stefan Ring
2018-10-07 16:21 ` Darrick J. Wong
2018-10-10 9:37 ` Stefan Ring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181005205733.GC19324@magnolia \
--to=darrick.wong@oracle.com \
--cc=linux-xfs@vger.kernel.org \
--cc=stefanrin@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.