]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: Return from xfs_attr_set_iter if there are no more rmtblks to process
authorAllison Henderson <allison.henderson@oracle.com>
Wed, 4 May 2022 02:40:02 +0000 (12:40 +1000)
committerDave Chinner <david@fromorbit.com>
Wed, 4 May 2022 02:40:02 +0000 (12:40 +1000)
commit5beddfcd2dd1c1b2e293423d2f224a0219438293
treefc9c4172703e9bebbd7343e2011b18e8b172bbab
parent410259dd24c46a1e6779df1af4e25a463d33c624
xfs: Return from xfs_attr_set_iter if there are no more rmtblks to process

During an attr rename operation, blocks are saved for later removal
as rmtblkno2. The rmtblkno is used in the case of needing to alloc
more blocks if not enough were available.  However, in the case
that no further blocks need to be added or removed, we can return as soon
as xfs_attr_node_addname completes, rather than rolling the transaction
with an -EAGAIN return.  This extra loop does not hurt anything right
now, but it will be a problem later when we get into log items because
we end up with an empty log transaction.  So, add a simple check to
cut out the unneeded iteration.

Signed-off-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/libxfs/xfs_attr.c