]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
xfs: fail _dir_open when readahead fails
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 2 Feb 2017 23:13:58 +0000 (15:13 -0800)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 21 Apr 2017 08:11:11 +0000 (10:11 +0200)
commit84a3fe64dc06acf637fe34e88f607ed145c1ba17
treeea5a7af149c31eafd3d0d3706787e0e5dcf54d39
parent3b3b7e3e286bbda4bd09592005348fb904559afb
xfs: fail _dir_open when readahead fails

BugLink: http://bugs.launchpad.net/bugs/1681875
commit 7a652bbe366464267190c2792a32ce4fff5595ef upstream.

When we open a directory, we try to readahead block 0 of the directory
on the assumption that we're going to need it soon.  If the bmbt is
corrupt, the directory will never be usable and the readahead fails
immediately, so we might as well prevent the directory from being opened
at all.  This prevents a subsequent read or modify operation from
hitting it and taking the fs offline.

NOTE: We're only checking for early failures in the block mapping, not
the readahead directory block itself.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
fs/xfs/libxfs/xfs_da_btree.c
fs/xfs/libxfs/xfs_da_btree.h
fs/xfs/xfs_file.c