]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: scrub should mark a directory corrupt if any entries cannot be iget'd
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 2 Dec 2020 20:25:44 +0000 (12:25 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 9 Dec 2020 17:49:38 +0000 (09:49 -0800)
commitfa6d7715964de6f19a535f3c7dacbc9abdd31384
treede5cb179d3be24c81f81931943c415de34e46c69
parent86d7d3190d42fbf3969eec38687e2d77cbc37764
xfs: scrub should mark a directory corrupt if any entries cannot be iget'd

It's possible that xfs_iget can return EINVAL for inodes that the inobt
thinks are free, or ENOENT for inodes that look free.  If this is the
case, mark the directory corrupt immediately when we check ftype.  Note
that we already check the ftype of the '.' and '..' entries, so we
can skip the iget part since we already know the inode type for '.' and
we have a separate parent pointer scrubber for '..'.

Fixes: 327d22f1a032 ("xfs: scrub directory metadata")
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/scrub/dir.c