]> git.itanic.dy.fi Git - linux-stable/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 Jul 2020 14:43:16 +0000 (16:43 +0200)
commitf88efa4d6cb1fcacb9591979bacc6c57ec9d7c53
treeba0675c36f1fbac868d31a6b31a16dfa4158b53b
parent7ce093c22159f871c769c27d65722aa6f8bd7e7f
xfs: set format back to extents if xfs_bmap_extents_to_btree

commit 2c4306f719b083d17df2963bc761777576b8ad1b upstream.

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>
[iwamatsu: backported to 4.4.y]
Signed-off-by: Nobuhiro Iwamatsu (CIP) <nobuhiro1.iwamatsu@toshiba.co.jp>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/libxfs/xfs_bmap.c