From: "Darrick J. Wong" <djwong@kernel.org>
To: Dave Chinner <david@fromorbit.com>
Cc: Alli <allison.henderson@oracle.com>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH v1 14/17] xfs: Add the parent pointer support to the superblock version 5.
Date: Wed, 29 Jun 2022 11:16:03 -0700 [thread overview]
Message-ID: <YryW44+cr+F1Zox6@magnolia> (raw)
In-Reply-To: <20220620002126.GM227878@dread.disaster.area>
On Mon, Jun 20, 2022 at 10:21:26AM +1000, Dave Chinner wrote:
> On Fri, Jun 17, 2022 at 05:32:36PM -0700, Alli wrote:
> > On Thu, 2022-06-16 at 16:03 +1000, Dave Chinner wrote:
> > > On Sat, Jun 11, 2022 at 02:41:57AM -0700, Allison Henderson wrote:
> > > > [dchinner: forward ported and cleaned up]
> > > > [achender: rebased and added parent pointer attribute to
> > > > compatible attributes mask]
> > > >
> > > > Signed-off-by: Mark Tinguely <tinguely@sgi.com>
> > > > Signed-off-by: Dave Chinner <dchinner@redhat.com>
> > > > Signed-off-by: Allison Henderson <allison.henderson@oracle.com>
> > > > Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
> > > > ---
> > > > fs/xfs/libxfs/xfs_format.h | 14 +++++++++-----
> > > > fs/xfs/libxfs/xfs_fs.h | 1 +
> > > > fs/xfs/libxfs/xfs_sb.c | 2 ++
> > > > fs/xfs/xfs_super.c | 4 ++++
> > > > 4 files changed, 16 insertions(+), 5 deletions(-)
> > > >
> > > > diff --git a/fs/xfs/libxfs/xfs_format.h
> > > > b/fs/xfs/libxfs/xfs_format.h
> > > > index 96976497306c..e85d6b643622 100644
> > > > --- a/fs/xfs/libxfs/xfs_format.h
> > > > +++ b/fs/xfs/libxfs/xfs_format.h
> > > > @@ -83,6 +83,7 @@ struct xfs_ifork;
> > > > #define XFS_SB_VERSION2_OKBITS \
> > > > (XFS_SB_VERSION2_LAZYSBCOUNTBIT | \
> > > > XFS_SB_VERSION2_ATTR2BIT | \
> > > > + XFS_SB_VERSION2_PARENTBIT | \
> > > > XFS_SB_VERSION2_PROJID32BIT | \
> > > > XFS_SB_VERSION2_FTYPE)
> > >
> > > No need for a v4 filesystem format feature bit - this is v4 only.
> > Ok, I ended up having to add this in the rebase or we get an "SB
> > validate failed". I think it has to go over in
> > xfs_sb_validate_v5_features next to the manual crc bit check. Will
> > move
>
> Ah, I meant that parent pointers are a v5 only feature, and so we
> don't need a "v4 only" feature bit for it. As it is, we can't use
> that specific bit because SGI shipped a version of parent pointers
> on v4 filesystems on IRIX under that feature bit that was broken and
> subsequently recalled and killed. Essentially, that means
> XFS_SB_VERSION2_PARENTBIT is blacklisted and cannot ever be used by
> upstream kernels.
>
> > > > @@ -353,11 +354,13 @@ xfs_sb_has_compat_feature(
> > > > #define XFS_SB_FEAT_RO_COMPAT_RMAPBT (1 << 1) /*
> > > > reverse map btree */
> > > > #define XFS_SB_FEAT_RO_COMPAT_REFLINK (1 << 2) /*
> > > > reflinked files */
> > > > #define XFS_SB_FEAT_RO_COMPAT_INOBTCNT (1 << 3) /*
> > > > inobt block counts */
> > > > +#define XFS_SB_FEAT_RO_COMPAT_PARENT (1 << 4) /*
> > > > parent inode ptr */
> > > > #define XFS_SB_FEAT_RO_COMPAT_ALL \
> > > > - (XFS_SB_FEAT_RO_COMPAT_FINOBT | \
> > > > - XFS_SB_FEAT_RO_COMPAT_RMAPBT | \
> > > > - XFS_SB_FEAT_RO_COMPAT_REFLINK| \
> > > > - XFS_SB_FEAT_RO_COMPAT_INOBTCNT)
> > > > + (XFS_SB_FEAT_RO_COMPAT_FINOBT | \
> > > > + XFS_SB_FEAT_RO_COMPAT_RMAPBT | \
> > > > + XFS_SB_FEAT_RO_COMPAT_REFLINK | \
> > > > + XFS_SB_FEAT_RO_COMPAT_INOBTCNT| \
> > > > + XFS_SB_FEAT_RO_COMPAT_PARENT)
> > >
> > > I'm not sure this is a RO Compat feature - we added an attribute
> > > namespace flag on disk, and the older kernels do not know about
> > > that (i.e. we changed XFS_ATTR_NSP_ONDISK_MASK). This may result in
> > > parent pointer attrs being exposed as user attrs rather than being
> > > hidden, or maybe parent pointer attrs being seen as corrupt because
> > > they have a flag that isn't defined set, etc.
> > >
> > > Hence I'm not sure that this classification is correct.
> >
> > Gosh, I'm sure there was a reason we did this, but what ever it was
> > goes all the way back in the first re-appearance of the set back in
> > 2018 and I just cant remember the discussion at the time. It may have
> > just been done to get mkfs working and we just never got to reviewing
> > it.
> >
> > Should we drop it and just use XFS_SB_VERSION2_PARENTBIT?
>
> No, it needs to be a v5 feature bit - create a v5 parent pointer
> filesystem, create some files on it, and then go an mount it on a
> kernel that doesn't have PP support. If you can see the parent
> pointer attributes from userspace as "user.<binary garbage>"
> attributes, then we need to use an INCOMPAT feature bit rather than
> a RO_COMPAT bit.
Agreed, this needs to be a v5 feature bit.
If the current kernel ignores xattr leaf entries with namespaces it
doesn't know about, *then* this could be an rocompat feature.
Otherwise, it has to be incompat.
As it is, I think the attr list functions will return *every* xattr
regardless of namespace, so I think it's not safe to let old kernels
mount pptr filesystems even in readonly mode.
--D
> Cheers,
>
> Dave.
> --
> Dave Chinner
> david@fromorbit.com
next prev parent reply other threads:[~2022-06-29 18:16 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-11 9:41 [PATCH v1 00/17] Return of the Parent Pointers Allison Henderson
2022-06-11 9:41 ` [PATCH v1 01/17] xfs: Add larp state XFS_DAS_CREATE_FORK Allison Henderson
2022-06-15 1:09 ` Dave Chinner
2022-06-15 23:40 ` Alli
2022-06-16 2:08 ` Dave Chinner
2022-06-16 5:32 ` Dave Chinner
2022-06-29 6:33 ` Alli
2022-06-30 0:40 ` Darrick J. Wong
2022-06-11 9:41 ` [PATCH v1 02/17] xfs: Hold inode locks in xfs_ialloc Allison Henderson
2022-06-29 18:28 ` Darrick J. Wong
2022-06-11 9:41 ` [PATCH v1 03/17] xfs: get directory offset when adding directory name Allison Henderson
2022-06-29 18:29 ` Darrick J. Wong
2022-06-11 9:41 ` [PATCH v1 04/17] xfs: get directory offset when removing " Allison Henderson
2022-06-29 18:30 ` Darrick J. Wong
2022-06-11 9:41 ` [PATCH v1 05/17] xfs: get directory offset when replacing a " Allison Henderson
2022-06-29 18:30 ` Darrick J. Wong
2022-06-11 9:41 ` [PATCH v1 06/17] xfs: add parent pointer support to attribute code Allison Henderson
2022-06-29 18:33 ` Darrick J. Wong
2022-06-29 18:58 ` Alli
2022-06-11 9:41 ` [PATCH v1 07/17] xfs: define parent pointer xattr format Allison Henderson
2022-06-29 18:34 ` Darrick J. Wong
2022-06-11 9:41 ` [PATCH v1 08/17] xfs: Add xfs_verify_pptr Allison Henderson
2022-06-29 18:35 ` Darrick J. Wong
2022-06-11 9:41 ` [PATCH v1 09/17] xfs: extent transaction reservations for parent attributes Allison Henderson
2022-06-16 5:38 ` Dave Chinner
2022-06-18 0:31 ` Alli
2022-06-29 18:37 ` Darrick J. Wong
2022-06-29 19:23 ` Alli
2022-06-11 9:41 ` [PATCH v1 10/17] xfs: parent pointer attribute creation Allison Henderson
2022-06-16 5:49 ` Dave Chinner
2022-06-18 0:32 ` Alli
2022-06-29 18:41 ` Darrick J. Wong
2022-06-30 1:29 ` Alli
2022-06-11 9:41 ` [PATCH v1 11/17] xfs: add parent attributes to link Allison Henderson
2022-06-16 22:39 ` Dave Chinner
2022-06-18 0:32 ` Alli
2022-06-29 18:09 ` Darrick J. Wong
2022-06-11 9:41 ` [PATCH v1 12/17] xfs: remove parent pointers in unlink Allison Henderson
2022-06-29 17:35 ` Darrick J. Wong
2022-06-11 9:41 ` [PATCH v1 13/17] xfs: Add parent pointers to rename Allison Henderson
2022-06-29 18:02 ` Darrick J. Wong
2022-06-11 9:41 ` [PATCH v1 14/17] xfs: Add the parent pointer support to the superblock version 5 Allison Henderson
2022-06-16 6:03 ` Dave Chinner
2022-06-18 0:32 ` Alli
2022-06-20 0:21 ` Dave Chinner
2022-06-29 18:16 ` Darrick J. Wong [this message]
2022-06-11 9:41 ` [PATCH v1 15/17] xfs: Add helper function xfs_attr_list_context_init Allison Henderson
2022-06-29 18:42 ` Darrick J. Wong
2022-06-30 1:30 ` Alli
2022-06-11 9:41 ` [PATCH v1 16/17] xfs: Increase XFS_DEFER_OPS_NR_INODES to 4 Allison Henderson
2022-06-16 21:54 ` Dave Chinner
2022-06-18 0:32 ` Alli
2022-06-29 18:43 ` Darrick J. Wong
2022-06-30 1:30 ` Alli
2022-06-11 9:42 ` [PATCH v1 17/17] xfs: Add parent pointer ioctl Allison Henderson
2022-06-29 18:52 ` Darrick J. Wong
2022-06-30 1:30 ` Alli
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=YryW44+cr+F1Zox6@magnolia \
--to=djwong@kernel.org \
--cc=allison.henderson@oracle.com \
--cc=david@fromorbit.com \
--cc=linux-xfs@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox