xfs: set format back to extents if xfs_bmap_extents_to_btree
authorEric Sandeen <sandeen@redhat.com>
Tue, 17 Apr 2018 06:07:27 +0000 (23:07 -0700)
committerBastian Blank <waldi@debian.org>
Fri, 22 Jun 2018 09:50:22 +0000 (10:50 +0100)
commit8d5fdf28294868f597452821298865a7a578e0be
tree5c5c4bd4eafd72273da0d9bff85fa3c27cf7eaa6
parentd076a108fb8ccce39421ee33c25e9730f5961b9a
xfs: set format back to extents if xfs_bmap_extents_to_btree

If xfs_bmap_extents_to_btree fails in a mode where we call
xfs_iroot_realloc(-1) to de-allocate the root, set the
format back to extents.

Otherwise we can assume we can dereference ifp->if_broot
based on the XFS_DINODE_FMT_BTREE format, and crash.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199423
Signed-off-by: Eric Sandeen <sandeen@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>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name xfs-set-format-back-to-extents-if-xfs_bmap_extents_t.patch
fs/xfs/libxfs/xfs_bmap.c