diff mbox series

xfs: reset XFS_ATTR_INCOMPLETE filter on node removal

Message ID 20231114200116.164007-1-aalbersh@redhat.com (mailing list archive)
State Superseded
Headers show
Series xfs: reset XFS_ATTR_INCOMPLETE filter on node removal | expand

Commit Message

Andrey Albershteyn Nov. 14, 2023, 8:01 p.m. UTC
In XFS_DAS_NODE_REMOVE_ATTR case, xfs_attr_mode_remove_attr() sets
filter to XFS_ATTR_INCOMPLETE. The filter is then reset in
xfs_attr_complete_op() if XFS_DA_OP_REPLACE operation is performed.

The filter is not reset though if XFS just removes the attribute
(args->value == NULL) with xfs_attr_defer_remove(). attr code goes
to XFS_DAS_DONE state.

Fix this by always resetting XFS_ATTR_INCOMPLETE filter. The replace
operation already resets this filter in anyway and others are
completed at this step hence don't need it.

Signed-off-by: Andrey Albershteyn <aalbersh@redhat.com>
---
 fs/xfs/libxfs/xfs_attr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c
index e28d93d232de..79ff633ad63d 100644
--- a/fs/xfs/libxfs/xfs_attr.c
+++ b/fs/xfs/libxfs/xfs_attr.c
@@ -421,8 +421,8 @@  xfs_attr_complete_op(
 	bool			do_replace = args->op_flags & XFS_DA_OP_REPLACE;
 
 	args->op_flags &= ~XFS_DA_OP_REPLACE;
+	args->attr_filter &= ~XFS_ATTR_INCOMPLETE;
 	if (do_replace) {
-		args->attr_filter &= ~XFS_ATTR_INCOMPLETE;
 		return replace_state;
 	}
 	return XFS_DAS_DONE;