From: liuh Date: Wed, 24 Jun 2026 08:11:35 +0000 (+0800) Subject: fsr: preserve xfrog_bulkstat error codes X-Git-Tag: v7.1.0~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d89fea99c26e4301c5f6ecdd509999cce9fbc7bf;p=thirdparty%2Fxfsprogs-dev.git fsr: preserve xfrog_bulkstat error codes 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 Cc: # v5.3.0 Fixes: e6542132dec3cd ("libfrog: convert bulkstat.c functions to negative error codes") Reviewed-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig --- diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c index e74180c14..68cc0ea45 100644 --- a/fsr/xfs_fsr.c +++ b/fsr/xfs_fsr.c @@ -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;