]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: remove redundant ASSERT on insufficient bestfree length in _leaf_addname
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 28 Jun 2018 20:11:57 +0000 (15:11 -0500)
committerEric Sandeen <sandeen@redhat.com>
Thu, 28 Jun 2018 20:11:57 +0000 (15:11 -0500)
commitb831204b5a4d34fa38737a08d544d32892539c93
tree634122269f8ccaf377dfbf9185675a5120e6039b
parent1b49337e259a429a21ac9803b4936324f4cb4ed9
xfs: remove redundant ASSERT on insufficient bestfree length in _leaf_addname

Source kernel commit: b3986010cea509842edf15c56ca10c18befdcafb

In xfs_dir2_leaf_addname we ASSERT if the length of the unused space
described by bestfree[0] is less the amount of space we wish to consume.
Immediately after it is a call to xfs_dir2_data_use_free where the
offset parameter is offset of the unused space and the length parameter
is the amount of space we wish to consume.  Both values (and the unused
space pointer) are passed into xfs_dir2_data_check_free, which also
validates that the region of unused space is big enough to cover the
space we wish to consume.  This is effectively the same check that the
ASSERT covers, and since a check failure results in a corruption message
being logged we can remove the ASSERT.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_dir2_leaf.c