From: "Darrick J. Wong" <djwong@kernel.org>
To: Stephen Zhang <starzhangzsd@gmail.com>
Cc: sandeen@redhat.com, hch@lst.de, zhangshida@kylinos.cn,
linux-xfs@vger.kernel.org
Subject: Re: [PATCH] libfrog: fix the if condition in xfrog_bulk_req_v1_setup
Date: Fri, 29 Jul 2022 08:44:13 -0700 [thread overview]
Message-ID: <YuQATS8/CujZV3lh@magnolia> (raw)
In-Reply-To: <20220729075746.1918783-1-zhangshida@kylinos.cn>
On Fri, Jul 29, 2022 at 03:57:46PM +0800, Stephen Zhang wrote:
> when scanning all inodes in each ag, hdr->ino serves as a iterator to
> specify the ino to start scanning with.
>
> After hdr->ino-- , we can get the last ino returned from the previous
> iteration.
>
> But there are cases that hdr->ino-- is pointless, that is,the case when
> starting to scan inodes in each ag.
>
> Hence the condition should be cvt_ino_to_agno(xfd, hdr->ino) ==0, which
> represents the start of scan in each ag,
Er, cvt_ino_to_agno extracts the AG number from an inumber;
cvt_ino_to_agino extracts the inumber within an AG. Given your
description of the problem (not wanting hdr->ino to go backwards in the
inumber space when it's already at the start of an AG), I think you want
the latter here?
> instead of hdr->ino ==0, which represents the start of scan in ag 0 only.
>
> Signed-off-by: Stephen Zhang <zhangshida@kylinos.cn>
> ---
> libfrog/bulkstat.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libfrog/bulkstat.c b/libfrog/bulkstat.c
> index 195f6ea0..77a385bb 100644
> --- a/libfrog/bulkstat.c
> +++ b/libfrog/bulkstat.c
> @@ -172,7 +172,7 @@ xfrog_bulk_req_v1_setup(
> if (!buf)
> return -errno;
>
> - if (hdr->ino)
> + if (cvt_ino_to_agno(xfd, hdr->ino))
...because I think this change means that we go backwards for any inode
in AG 0, and we do not go backwards for any other AG.
--D
> hdr->ino--;
> bulkreq->lastip = (__u64 *)&hdr->ino,
> bulkreq->icount = hdr->icount,
> --
> 2.25.1
>
next prev parent reply other threads:[~2022-07-29 15:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-29 7:57 [PATCH] libfrog: fix the if condition in xfrog_bulk_req_v1_setup Stephen Zhang
2022-07-29 15:44 ` Darrick J. Wong [this message]
2022-07-30 1:25 ` Stephen Zhang
2022-07-30 1:30 ` Darrick J. Wong
2022-07-30 7:51 ` Stephen Zhang
2022-07-31 16:44 ` Darrick J. Wong
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=YuQATS8/CujZV3lh@magnolia \
--to=djwong@kernel.org \
--cc=hch@lst.de \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@redhat.com \
--cc=starzhangzsd@gmail.com \
--cc=zhangshida@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox