From: Darrick J. Wong Date: Fri, 1 May 2020 21:37:09 +0000 (-0400) Subject: xfs: fix incorrect test in xfs_alloc_ag_vextent_lastblock X-Git-Tag: v5.7.0-rc0~12 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=2c711623374764cd7f9e95da7fdf4d9e90feb4c0;p=thirdparty%2Fxfsprogs-dev.git xfs: fix incorrect test in xfs_alloc_ag_vextent_lastblock Source kernel commit: 77ca1eed5a7d2bf0905562eb1a15aac76bc19fe4 When I lifted the code in xfs_alloc_ag_vextent_lastblock out of a loop, I forgot to convert all the accesses to len to be pointer dereferences. Coverity-id: 1457918 Fixes: 5113f8ec3753ed ("xfs: clean up weird while loop in xfs_alloc_ag_vextent_near") Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster Reviewed-by: Christoph Hellwig Signed-off-by: Eric Sandeen --- diff --git a/libxfs/xfs_alloc.c b/libxfs/xfs_alloc.c index 841b03050..fee4039ca 100644 --- a/libxfs/xfs_alloc.c +++ b/libxfs/xfs_alloc.c @@ -1510,7 +1510,7 @@ xfs_alloc_ag_vextent_lastblock( * maxlen, go to the start of this block, and skip all those smaller * than minlen. */ - if (len || args->alignment > 1) { + if (*len || args->alignment > 1) { acur->cnt->bc_ptrs[0] = 1; do { error = xfs_alloc_get_rec(acur->cnt, bno, len, &i);