All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
To: Damien Le Moal <dlemoal@kernel.org>
Cc: "fio@vger.kernel.org" <fio@vger.kernel.org>,
	Jens Axboe <axboe@kernel.dk>, Vincent Fu <vincentfu@gmail.com>
Subject: Re: [PATCH v3 2/8] zbd: fix write zone accounting
Date: Mon, 2 Mar 2026 06:49:48 +0000	[thread overview]
Message-ID: <aaUy7dt-QeaFOJLN@shinmob> (raw)
In-Reply-To: <35cc81d1-ef4e-4b21-88ea-6386075677c3@kernel.org>

On Mar 02, 2026 / 12:41, Damien Le Moal wrote:
[...]
> > diff --git a/zbd.c b/zbd.c
> > index b71f842c..c511b709 100644
> > --- a/zbd.c
> > +++ b/zbd.c
> > @@ -1693,8 +1693,17 @@ retry:
> >  
> >  		zone_lock(td, f, z);
> >  		if (zbd_zone_remainder(z) >= min_bs) {
> > -			need_zone_finish = false;
> > -			goto out;
> > +			/*
> > +			 * The zone might be already removed from
> > +			 * zbdi->write_zones[] by other jobs at this moment.
> > +			 * Even if the zone has remainder, call
> > +			 * zbd_write_zone_get() to ensure that it is in the
> > +			 * array.
> > +			 */
> > +			if (zbd_write_zone_get(td, f, z)) {
> > +				need_zone_finish = false;
> > +				goto out;
> > +			}
> 
> Please change this to:
> 
> 		if (zbd_zone_remainder(z) >= min_bs &&
> 		    zbd_write_zone_get(td, f, z)) {
> 			need_zone_finish = false;
> 			goto out;
> 		}
> 
> And move the comment block above the if. You could also improve the comment to
> explain why we look at "zbd_zone_remainder(z) >= min_bs"
> 
> With that (and the much better commit message), feel free to add:
> 
> Reviewed-by: Damien Le Moal <dlemoal@kernel.org>

Thanks, will reflect the comments in v4.

  reply	other threads:[~2026-03-02  6:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-02  2:26 [PATCH v3 0/8] zbd: fix problems of random write with unaligned block size Shin'ichiro Kawasaki
2026-03-02  2:26 ` [PATCH v3 1/8] zbd: fix zone selection of random writes Shin'ichiro Kawasaki
2026-03-02  2:26 ` [PATCH v3 2/8] zbd: fix write zone accounting Shin'ichiro Kawasaki
2026-03-02  3:41   ` Damien Le Moal
2026-03-02  6:49     ` Shinichiro Kawasaki [this message]
2026-03-02  2:26 ` [PATCH v3 3/8] zbd: introduce write_zone_remainder option Shin'ichiro Kawasaki
2026-03-02  4:36   ` Damien Le Moal
2026-03-02  6:51     ` Shinichiro Kawasaki
2026-03-02  2:26 ` [PATCH v3 4/8] doc: explain the option write_zone_remainder Shin'ichiro Kawasaki
2026-03-02  2:26 ` [PATCH v3 5/8] t/zbd: add -m option to enable write_zone_remainder option Shin'ichiro Kawasaki
2026-03-02  2:26 ` [PATCH v3 6/8] t/zbd: avoid test case 14 failure with " Shin'ichiro Kawasaki
2026-03-02  2:26 ` [PATCH v3 7/8] t/zbd: avoid test case 33 " Shin'ichiro Kawasaki
2026-03-02  2:26 ` [PATCH v3 8/8] t/zbd: avoid test case 71 " Shin'ichiro Kawasaki
2026-03-02  5:06 ` [PATCH v3 0/8] zbd: fix problems of random write with unaligned block size fiotestbot

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=aaUy7dt-QeaFOJLN@shinmob \
    --to=shinichiro.kawasaki@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=dlemoal@kernel.org \
    --cc=fio@vger.kernel.org \
    --cc=vincentfu@gmail.com \
    /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.