* [RESEND] xfs: reset XFS_ATTR_INCOMPLETE filter on node removal
@ 2024-01-24 9:40 Andrey Albershteyn
2024-01-24 9:42 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: Andrey Albershteyn @ 2024-01-24 9:40 UTC (permalink / raw)
To: linux-xfs; +Cc: djwong, chandan.babu, Andrey Albershteyn
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 | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c
index 9976a00a73f9..e965a48e7db9 100644
--- a/fs/xfs/libxfs/xfs_attr.c
+++ b/fs/xfs/libxfs/xfs_attr.c
@@ -421,10 +421,10 @@ xfs_attr_complete_op(
bool do_replace = args->op_flags & XFS_DA_OP_REPLACE;
args->op_flags &= ~XFS_DA_OP_REPLACE;
- if (do_replace) {
- args->attr_filter &= ~XFS_ATTR_INCOMPLETE;
+ args->attr_filter &= ~XFS_ATTR_INCOMPLETE;
+ if (do_replace)
return replace_state;
- }
+
return XFS_DAS_DONE;
}
--
2.40.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [RESEND] xfs: reset XFS_ATTR_INCOMPLETE filter on node removal
2024-01-24 9:40 [RESEND] xfs: reset XFS_ATTR_INCOMPLETE filter on node removal Andrey Albershteyn
@ 2024-01-24 9:42 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2024-01-24 9:42 UTC (permalink / raw)
To: Andrey Albershteyn; +Cc: linux-xfs, djwong, chandan.babu
On Wed, Jan 24, 2024 at 10:40:33AM +0100, Andrey Albershteyn wrote:
> 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>
Shuld this have a Fixes: tag?
Otherwise looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-01-24 9:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-24 9:40 [RESEND] xfs: reset XFS_ATTR_INCOMPLETE filter on node removal Andrey Albershteyn
2024-01-24 9:42 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox