Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Johannes Thumshirn <morbidrsa@gmail.com>
To: Damien Le Moal <dlemoal@kernel.org>
Cc: Johannes Thumshirn <jth@kernel.org>,
	linux-btrfs@vger.kernel.org, Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>,
	Naohiro Aota <naohiro.aota@wdc.com>,
	Johannes Thumshirn <johannes.thumshirn@wdc.com>
Subject: Re: [PATCH] btrfs: zoned: skip ZONE FINISH of conventional zones
Date: Thu, 24 Jul 2025 08:51:19 +0200	[thread overview]
Message-ID: <aIHX5yG1tE4JCMPx@nuc> (raw)
In-Reply-To: <3786245c-60d5-4567-a505-3c05ba8610f6@kernel.org>

On Thu, Jul 24, 2025 at 08:56:43AM +0900, Damien Le Moal wrote:
> > +	if (!device->bdev)
> > +		return 0;
> > +
> > +	if (zinfo->max_active_zones == 0)
> > +		return 0;
> 
> Should these 2 returns be replaced with a "goto out;"...
> 
> > +
> > +	if (btrfs_dev_is_sequential(device, physical)) {
> > +		unsigned int nofs_flags;
> > +
> > +		nofs_flags = memalloc_nofs_save();
> > +		ret = blkdev_zone_mgmt(device->bdev, REQ_OP_ZONE_FINISH,
> > +				       physical >> SECTOR_SHIFT,
> > +				       zinfo->zone_size >> SECTOR_SHIFT);
> > +		memalloc_nofs_restore(nofs_flags);
> > +
> > +		if (ret)
> > +			return ret;
> > +	}
> > +
> 
> With "out:" label here ?
> 
> That was not done before, but I wonder if that is needed.
> 
> > +	if (!(block_group->flags & BTRFS_BLOCK_GROUP_DATA))
> > +		zinfo->reserved_active_zones++;
> > +	btrfs_dev_clear_active_zone(device, physical);

I don't think so. If device->bdev == NULL it means the device is missing and
we can't do anything with it. If zone_info->max_active_zones == 0, it means we
don't do active zone tracking on that device.

  reply	other threads:[~2025-07-24  6:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-23 13:38 [PATCH] btrfs: zoned: skip ZONE FINISH of conventional zones Johannes Thumshirn
2025-07-23 23:56 ` Damien Le Moal
2025-07-24  6:51   ` Johannes Thumshirn [this message]
2025-07-26 17:57 ` Anand Jain
2025-07-28  4:22 ` Naohiro Aota

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=aIHX5yG1tE4JCMPx@nuc \
    --to=morbidrsa@gmail.com \
    --cc=dlemoal@kernel.org \
    --cc=dsterba@suse.com \
    --cc=johannes.thumshirn@wdc.com \
    --cc=josef@toxicpanda.com \
    --cc=jth@kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=naohiro.aota@wdc.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox