diff mbox series

[08/32] xfs: allow logged xattr operations if parent pointers are enabled

Message ID 171270969690.3631889.15408823864477343629.stgit@frogsfrogsfrogs (mailing list archive)
State New
Headers show
Series [01/32] xfs: rearrange xfs_attr_match parameters | expand

Commit Message

Darrick J. Wong April 10, 2024, 12:55 a.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

Don't trip this assertion about attr log items if we have parent
pointers enabled.  Parent pointers are an incompat feature that doesn't
use any of the functionality protected by
XFS_SB_FEAT_INCOMPAT_LOG_XATTRS, which is why this is ok.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 fs/xfs/xfs_attr_item.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christoph Hellwig April 10, 2024, 5:18 a.m. UTC | #1
On Tue, Apr 09, 2024 at 05:55:35PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Don't trip this assertion about attr log items if we have parent
> pointers enabled.  Parent pointers are an incompat feature that doesn't
> use any of the functionality protected by
> XFS_SB_FEAT_INCOMPAT_LOG_XATTRS, which is why this is ok.

I'd move the checks into the switch on op below, so that we check the log
attrs feature for the "normal" logged attrs and the parent pointers flag
for the parent pointer ops.
Darrick J. Wong April 10, 2024, 9:18 p.m. UTC | #2
On Tue, Apr 09, 2024 at 10:18:17PM -0700, Christoph Hellwig wrote:
> On Tue, Apr 09, 2024 at 05:55:35PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> > 
> > Don't trip this assertion about attr log items if we have parent
> > pointers enabled.  Parent pointers are an incompat feature that doesn't
> > use any of the functionality protected by
> > XFS_SB_FEAT_INCOMPAT_LOG_XATTRS, which is why this is ok.
> 
> I'd move the checks into the switch on op below, so that we check the log
> attrs feature for the "normal" logged attrs and the parent pointers flag
> for the parent pointer ops.

Good idea.

--D
diff mbox series

Patch

diff --git a/fs/xfs/xfs_attr_item.c b/fs/xfs/xfs_attr_item.c
index 8f91016fc3cf8..c509bf841949f 100644
--- a/fs/xfs/xfs_attr_item.c
+++ b/fs/xfs/xfs_attr_item.c
@@ -474,7 +474,7 @@  xfs_attri_validate(
 {
 	unsigned int			op = xfs_attr_log_item_op(attrp);
 
-	if (!xfs_is_using_logged_xattrs(mp))
+	if (!xfs_is_using_logged_xattrs(mp) && !xfs_has_parent(mp))
 		return false;
 
 	if (attrp->__pad != 0)