]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: fail _dir_open when readahead fails
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 4 Apr 2017 20:37:43 +0000 (15:37 -0500)
committerEric Sandeen <sandeen@redhat.com>
Tue, 4 Apr 2017 20:37:43 +0000 (15:37 -0500)
commit3a65062f507e4a658bb7d639244bee689c9e8453
treeaccc54ca0753a89c81573f86ac47170912c52a55
parente59aa2ffc78eafb21657dc9ddb5aa9691e6acf1f
xfs: fail _dir_open when readahead fails

Source kernel commit: 7a652bbe366464267190c2792a32ce4fff5595ef

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: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_da_btree.c
libxfs/xfs_da_btree.h