xfs: fix xfs_init_attr_trans not handling explicit operation codes
authorDarrick J. Wong <djwong@kernel.org>
Wed, 22 May 2024 06:02:01 +0000 (23:02 -0700)
committerChandan Babu R <chandanbabu@kernel.org>
Mon, 27 May 2024 10:25:52 +0000 (15:55 +0530)
commit97835e6866796874571646a1a8ff44f24c0b39f7
tree9c4a7d078222b12c6ccb20cd249e9bdba23ba6cc
parent2b3f004d3d518ec7a392066d935fd85c81412e33
xfs: fix xfs_init_attr_trans not handling explicit operation codes

When we were converting the attr code to use an explicit operation code
instead of keying off of attr->value being null, we forgot to change the
code that initializes the transaction reservation.  Split the function
into two helpers that handle the !remove and remove cases, then fix both
callsites to handle this correctly.

Fixes: c27411d4c640 ("xfs: make attr removal an explicit operation")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
fs/xfs/libxfs/xfs_attr.c
fs/xfs/libxfs/xfs_attr.h
fs/xfs/xfs_attr_item.c