]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: fix brainos in the refcount scrubber's rmap fragment processor
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 9 Nov 2020 00:32:42 +0000 (16:32 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 11 Nov 2020 00:48:03 +0000 (16:48 -0800)
commit59f972f58f4cc093bed041159cd07004cb2dd93b
treeca82b2c3306f5277d703ee3d98ba77999b22e6dd
parent26e38edcef4f6aa56668bde3b0b0a4b013f4179b
xfs: fix brainos in the refcount scrubber's rmap fragment processor

Fix some serious WTF in the reference count scrubber's rmap fragment
processing.  The code comment says that this loop is supposed to move
all fragment records starting at or before bno onto the worklist, but
there's no obvious reason why nr (the number of items added) should
increment starting from 1, and breaking the loop when we've added the
target number seems dubious since we could have more rmap fragments that
should have been added to the worklist.

This seems to manifest in xfs/411 when adding one to the refcount field.

Fixes: 1171c2cc4876 ("xfs: cross-reference the rmapbt data with the refcountbt")
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/scrub/refcount.c