xfs: fix incorrect test in xfs_alloc_ag_vextent_lastblock
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 13 Mar 2020 20:57:58 +0000 (13:57 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Tue, 17 Mar 2020 14:32:46 +0000 (07:32 -0700)
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 <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/libxfs/xfs_alloc.c

index 337822115bbcfa47c313c398724773e49c2a23e9..203e74fa64aa661391733bc92b8f5dc26bd00681 100644 (file)
@@ -1514,7 +1514,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);