]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xfs: fix the minrecs logic when dealing with inode root child blocks
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 9 Nov 2020 00:32:41 +0000 (16:32 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Nov 2020 12:27:23 +0000 (13:27 +0100)
commit804b269c252445d3b98497c8b02db0152c65cd63
treef1b6a8a0fb6856014287a32cb42e8db17e4ee453
parent789cbe71299d4c648ae6aa88945dddff6cabe469
xfs: fix the minrecs logic when dealing with inode root child blocks

[ Upstream commit e95b6c3ef1311dd7b20467d932a24b6d0fd88395 ]

The comment and logic in xchk_btree_check_minrecs for dealing with
inode-rooted btrees isn't quite correct.  While the direct children of
the inode root are allowed to have fewer records than what would
normally be allowed for a regular ondisk btree block, this is only true
if there is only one child block and the number of records don't fit in
the inode root.

Fixes: 08a3a692ef58 ("xfs: btree scrub should check minrecs")
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/xfs/scrub/btree.c