]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
fsr: preserve xfrog_bulkstat error codes
authorliuh <liuhuan01@kylinos.cn>
Wed, 24 Jun 2026 08:11:35 +0000 (16:11 +0800)
committerAndrey Albershteyn <aalbersh@kernel.org>
Wed, 8 Jul 2026 08:40:42 +0000 (10:40 +0200)
Fix the bulkstat loop condition in fsrfs() to assign the return
value of xfrog_bulkstat() to ret before comparing it against zero.

Without the extra parentheses, operator precedence causes ret
to receive only the result of the comparison (0 or 1), which
discards the actual error code and breaks error reporting.

Signed-off-by: liuh <liuhuan01@kylinos.cn>
Cc: <linux-xfs@vger.kernel.org> # v5.3.0
Fixes: e6542132dec3cd ("libfrog: convert bulkstat.c functions to negative error codes")
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fsr/xfs_fsr.c

index e74180c143beff043cbf2ec6c282c706cb66f545..68cc0ea457ed85f42d06b083aa6b4e964491323e 100644 (file)
@@ -678,7 +678,7 @@ fsrfs(char *mntdir, xfs_ino_t startino, int targetrange)
                return -1;
        }
 
-       while ((ret = -xfrog_bulkstat(&fsxfd, breq) == 0)) {
+       while ((ret = -xfrog_bulkstat(&fsxfd, breq)) == 0) {
                struct xfs_bulkstat     *buf = breq->bulkstat;
                struct xfs_bulkstat     *p;
                struct xfs_bulkstat     *endp;