xfs: error out if trying to add attrs and anextents > 0
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 9 Jan 2017 15:38:55 +0000 (16:38 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2017 10:39:43 +0000 (11:39 +0100)
commit12815dd15c480c0d595401e4eec54542025607f6
treef760fdd4b0271e9bc55e821891a73cece3f67e49
parentcd4bf1d416ef199223fa41eb8225f2a137c0be99
xfs: error out if trying to add attrs and anextents > 0

commit 0f352f8ee8412bd9d34fb2a6411241da61175c0e upstream.

We shouldn't assert if somehow we end up trying to add an attr fork to
an inode that apparently already has attr extents because this is an
indication of on-disk corruption.  Instead, return an error code to
userspace.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/libxfs/xfs_bmap.c