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)
commitdc3ffbb14060c943469d5e12900db3a60bc3fa64
treea95dab3aef578fa63c08979574ded618849c2593
parentef8385128d4b31a382d496b1c433697993bd0bfb
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