]> git.itanic.dy.fi Git - linux-stable/commit
xfs: don't fail when converting shortform attr to long form during ATTR_REPLACE
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 18 Apr 2018 02:10:15 +0000 (19:10 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 16 Dec 2018 22:09:46 +0000 (22:09 +0000)
commit789a4317666e599e487ec1983643de1b519c431e
treecea5b45ef95261f0b57e9f7093da8498158c8389
parent2567a342d707b1245e837f16cb7555b360e2c580
xfs: don't fail when converting shortform attr to long form during ATTR_REPLACE

commit 7b38460dc8e4eafba06c78f8e37099d3b34d473c upstream.

Kanda Motohiro reported that expanding a tiny xattr into a large xattr
fails on XFS because we remove the tiny xattr from a shortform fork and
then try to re-add it after converting the fork to extents format having
not removed the ATTR_REPLACE flag.  This fails because the attr is no
longer present, causing a fs shutdown.

This is derived from the patch in his bug report, but we really
shouldn't ignore a nonzero retval from the remove call.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199119
Reported-by: kanda.motohiro@gmail.com
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
[bwh: Backported to 3.16: adjust filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/xfs/xfs_attr.c