]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
xfs: handle error if xfs_btree_get_bufs fails
authorEric Sandeen <sandeen@sandeen.net>
Tue, 10 Oct 2017 04:08:06 +0000 (21:08 -0700)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Thu, 16 Nov 2017 13:23:22 +0000 (11:23 -0200)
commit35988d03c02a11cba534a88639f4693f0be5ec39
treee5a0331055a203f40a1363128ac79261ffca673c
parentd9ce809d7bce0ec0bdab9542ed78e89729eb29ee
xfs: handle error if xfs_btree_get_bufs fails

BugLink: http://bugs.launchpad.net/bugs/1731951
commit 93e8befc17f6d6ea92b0aee3741ceac8bca4590f upstream.

Jason reported that a corrupted filesystem failed to replay
the log with a metadata block out of bounds warning:

XFS (dm-2): _xfs_buf_find: Block out of range: block 0x80270fff8, EOFS 0x9c40000

_xfs_buf_find() and xfs_btree_get_bufs() return NULL if
that happens, and then when xfs_alloc_fix_freelist() calls
xfs_trans_binval() on that NULL bp, we oops with:

BUG: unable to handle kernel NULL pointer dereference at 00000000000000f8

We don't handle _xfs_buf_find errors very well, every
caller higher up the stack gets to guess at why it failed.
But we should at least handle it somehow, so return
EFSCORRUPTED here.

Reported-by: Jason L Tibbitts III <tibbs@math.uh.edu>
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
fs/xfs/libxfs/xfs_alloc.c