]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: refactor the directory data block bestfree checks
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 6 Nov 2017 19:37:46 +0000 (11:37 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Thu, 9 Nov 2017 17:10:45 +0000 (09:10 -0800)
commit8cecee1f5b4b3325f515e28bde5bc2b43ce9501a
tree80a0903afd25b95c5196a5bfc4006af3c43da158
parent0ba346a48df0db61a79e773478f5e2733a8cbcc8
xfs: refactor the directory data block bestfree checks

In a directory data block, the zeroth bestfree item must point to the
longest free space.  Therefore, when we check the bestfree block's
records against the data blocks, we only need to compare with bf[0] and
don't need the loop.

The weird loop was most probably the result of an earlier refactoring
gone bad.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
fs/xfs/scrub/dir.c