]> asedeno.scripts.mit.edu Git - linux.git/commit
xfs: remove redundant ASSERT on insufficient bestfree length in _leaf_addname
authorDarrick J. Wong <darrick.wong@oracle.com>
Sun, 3 Jun 2018 23:10:13 +0000 (16:10 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 4 Jun 2018 21:45:29 +0000 (14:45 -0700)
commitb3986010cea509842edf15c56ca10c18befdcafb
tree3a59a3e5b4d6b894d37ebd3ead73ced8c4951476
parent17ba2cc7b5b9ee6a44baf5e169c8901f1f049ea8
xfs: remove redundant ASSERT on insufficient bestfree length in _leaf_addname

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>
fs/xfs/libxfs/xfs_dir2_leaf.c