]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: gut error handling in xfs_trans_unreserve_and_mod_sb()
authorDave Chinner <david@fromorbit.com>
Wed, 20 May 2020 20:17:10 +0000 (13:17 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 27 May 2020 15:49:25 +0000 (08:49 -0700)
commit146c4131643d4424996d6d9dc2a6a01f74d87612
treea95dab3aef578fa63c08979574ded618849c2593
parentbbda66c0e716fc6ca22ca86afbbeee417fff1faf
xfs: gut error handling in xfs_trans_unreserve_and_mod_sb()

xfs: gut error handling in xfs_trans_unreserve_and_mod_sb()

From: Dave Chinner <dchinner@redhat.com>

The error handling in xfs_trans_unreserve_and_mod_sb() is largely
incorrect - rolling back the changes in the transaction if only one
counter underruns makes all the other counters incorrect. We still
allow the change to proceed and committing the transaction, except
now we have multiple incorrect counters instead of a single
underflow.

Further, we don't actually report the error to the caller, so this
is completely silent except on debug kernels that will assert on
failure before we even get to the rollback code.  Hence this error
handling is broken, untested, and largely unnecessary complexity.

Just remove it.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_trans.c