]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: eliminate committed arg from xfs_bmap_finish
authorEric Sandeen <sandeen@sandeen.net>
Wed, 17 Feb 2016 05:44:57 +0000 (16:44 +1100)
committerDave Chinner <david@fromorbit.com>
Wed, 17 Feb 2016 05:44:57 +0000 (16:44 +1100)
commit0b66d459828a5d1210c09f1d1a4f61a18e9ce478
tree99f685a78316537fb2277b0a448119bb486b5942
parentf07ae2a662c1cb6d10481b73ec7a3f5f02ab2ae9
xfs: eliminate committed arg from xfs_bmap_finish

Source kernel commit f6106efae5f4144b32f6c10de0dc3e7efc9181e3

Calls to xfs_bmap_finish() and xfs_trans_ijoin(), and the
associated comments were replicated several times across
the attribute code, all dealing with what to do if the
transaction was or wasn't committed.

And in that replicated code, an ASSERT() test of an
uninitialized variable occurs in several locations:

error = xfs_attr_thing(&args);
if (!error) {
error = xfs_bmap_finish(&args.trans, args.flist,
&committed);
}
if (error) {
ASSERT(committed);

If the first xfs_attr_thing() failed, we'd skip the xfs_bmap_finish,
never set "committed", and then test it in the ASSERT.

Fix this up by moving the committed state internal to xfs_bmap_finish,
and add a new inode argument.  If an inode is passed in, it is passed
through to __xfs_trans_roll() and joined to the transaction there if
the transaction was committed.

xfs_qm_dqalloc() was a little unique in that it called bjoin rather
than ijoin, but as Dave points out we can detect the committed state
but checking whether (*tpp != tp).

Addresses-Coverity-Id: 102360
Addresses-Coverity-Id: 102361
Addresses-Coverity-Id: 102363
Addresses-Coverity-Id: 102364
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
include/libxfs.h
libxfs/util.c
libxfs/xfs_attr.c
libxfs/xfs_attr_remote.c
libxfs/xfs_bmap.c
libxfs/xfs_bmap.h
mkfs/proto.c
repair/phase6.c