public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>,
	Qu Wenruo <wqu@suse.com>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
	HAN Yuwei <hrx@bupt.moe>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH] btrfs: reject zoned RW mount if sectorsize is smaller than page size
Date: Wed, 14 Feb 2024 08:29:31 +0100	[thread overview]
Message-ID: <20240214072931.GN355@twin.jikos.cz> (raw)
In-Reply-To: <1150c409-f2ed-4e5a-a2b6-9f410fb7aff5@gmx.com>

On Mon, Feb 12, 2024 at 08:20:21PM +1030, Qu Wenruo wrote:
> 
> 
> On 2024/2/12 20:15, Johannes Thumshirn wrote:
> > On 12.02.24 06:16, Qu Wenruo wrote:
> >> Reported-by: HAN Yuwei <hrx@bupt.moe>
> >> Link: https://lore.kernel.org/all/1ACD2E3643008A17+da260584-2c7f-432a-9e22-9d390aae84cc@bupt.moe/
> >> CC: stable@vger.kernel.org # 5.10+
> >> Signed-off-by: Qu Wenruo <wqu@suse.com>
> >> ---
> >>    fs/btrfs/disk-io.c | 3 ++-
> >>    1 file changed, 2 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> >> index c3ab268533ca..85cd23aebdd6 100644
> >> --- a/fs/btrfs/disk-io.c
> >> +++ b/fs/btrfs/disk-io.c
> >> @@ -3193,7 +3193,8 @@ int btrfs_check_features(struct btrfs_fs_info *fs_info, bool is_rw_mount)
> >>    	 * part of @locked_page.
> >>    	 * That's also why compression for subpage only work for page aligned ranges.
> >>    	 */
> >> -	if (fs_info->sectorsize < PAGE_SIZE && btrfs_is_zoned(fs_info) && is_rw_mount) {
> >> +	if (fs_info->sectorsize < PAGE_SIZE &&
> >> +	    btrfs_fs_incompat(fs_info, ZONED) && is_rw_mount) {
> >>    		btrfs_warn(fs_info,
> >>    	"no zoned read-write support for page size %lu with sectorsize %u",
> >>    			   PAGE_SIZE, fs_info->sectorsize);
> >
> > Please keep btrfs_is_zoned(fs_info) instead of using
> > btrfs_fs_incompat(fs_info, ZONED).
> 
> At the time of calling, we haven't yet populate fs_info->zone_size, thus
> we have to use super flags to verify if it's zoned.
> 
> If needed, I can add a comment for it.

Yes please add a comment the difference is quite subtle.

  parent reply	other threads:[~2024-02-14  7:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-12  5:16 [PATCH] btrfs: reject zoned RW mount if sectorsize is smaller than page size Qu Wenruo
2024-02-12  9:45 ` Johannes Thumshirn
2024-02-12  9:50   ` Qu Wenruo
2024-02-12 10:25     ` Johannes Thumshirn
2024-02-14  7:29     ` David Sterba [this message]
2024-02-17  0:07       ` Qu Wenruo
2024-02-12 11:14 ` David Sterba
2024-02-12 22:54   ` Qu Wenruo
2024-02-14  7:28 ` David Sterba

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=20240214072931.GN355@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=hrx@bupt.moe \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.com \
    --cc=stable@vger.kernel.org \
    --cc=wqu@suse.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