]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: don't call xfs_da_shrink_inode with NULL bp
authorEric Sandeen <sandeen@sandeen.net>
Thu, 28 Jun 2018 20:11:58 +0000 (15:11 -0500)
committerEric Sandeen <sandeen@redhat.com>
Thu, 28 Jun 2018 20:11:58 +0000 (15:11 -0500)
commitb4b56fc4b493a6f2c81180d01f429a18b569b3bf
tree6dd02ec044a0ae399b70a30b08e961399259bb31
parentd7ff12b88da8018e69b7e9a8197b76abc98ef1e5
xfs: don't call xfs_da_shrink_inode with NULL bp

Source kernel commit: bb3d48dcf86a97dc25fe9fc2c11938e19cb4399a

xfs_attr3_leaf_create may have errored out before instantiating a buffer,
for example if the blkno is out of range.  In that case there is no work
to do to remove it, and in fact xfs_da_shrink_inode will lead to an oops
if we try.

This also seems to fix a flaw where the original error from
xfs_attr3_leaf_create gets overwritten in the cleanup case, and it
removes a pointless assignment to bp which isn't used after this.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199969
Reported-by: Xu, Wen <wen.xu@gatech.edu>
Tested-by: Xu, Wen <wen.xu@gatech.edu>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_attr_leaf.c