From: "Darrick J. Wong" <djwong@kernel.org>
To: liuh <liuhuan01@kylinos.cn>
Cc: hch@lst.de, linux-xfs@vger.kernel.org
Subject: Re: [PATCH] fsr: preserve xfrog_bulkstat error codes
Date: Wed, 24 Jun 2026 10:20:12 -0700 [thread overview]
Message-ID: <20260624172012.GP6078@frogsfrogsfrogs> (raw)
In-Reply-To: <20260624081135.12390-1-liuhuan01@kylinos.cn>
On Wed, Jun 24, 2026 at 04:11:35PM +0800, liuh wrote:
> 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>
> ---
> fsr/xfs_fsr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
> index e74180c1..68cc0ea4 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) {
Heh, oops.
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>
--D
> struct xfs_bulkstat *buf = breq->bulkstat;
> struct xfs_bulkstat *p;
> struct xfs_bulkstat *endp;
> --
> 2.43.0
>
>
prev parent reply other threads:[~2026-06-24 17:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-24 8:11 [PATCH] fsr: preserve xfrog_bulkstat error codes liuh
2026-06-24 8:14 ` Christoph Hellwig
2026-06-24 17:20 ` Darrick J. Wong [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260624172012.GP6078@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=hch@lst.de \
--cc=linux-xfs@vger.kernel.org \
--cc=liuhuan01@kylinos.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.