linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH 1/2] zonefs: fix zone report size in __zonefs_io_error()
Date: Wed, 2 Nov 2022 18:44:17 +0900	[thread overview]
Message-ID: <af8953db-cdb2-507c-1c54-88593fae4b74@opensource.wdc.com> (raw)
In-Reply-To: <959eb68a-3c74-3b57-dd81-8b46dfa341d9@wdc.com>

On 11/2/22 18:28, Johannes Thumshirn wrote:
> On 31.10.22 04:00, Damien Le Moal wrote:
>> +	/*
>> +	 * The only files that have more than one zone are conventional zone
>> +	 * files with aggregated conventional zones, for which the inode zone
>> +	 * size is always larger than the device zone size.
>> +	 */
>> +	if (zi->i_zone_size > bdev_zone_sectors(sb->s_bdev))
>> +		nr_zones = zi->i_zone_size >>
>> +			(sbi->s_zone_sectors_shift + SECTOR_SHIFT);
>> +
> 
> I wonder if we should also have a check/assertion like this somewhere: 
> WARN_ON_ONCE(zi->i_zone_size > bdev_zone_sectors(sb->sbdev) && 
> 	!sbi->s_features & ZONEFS_F_AGGRCNV)

Well, this is set when the inode is created on mount. So we could add the
check there, but I do not really see the point since we would be checking
exactly what we are doing. So the only chance warn ever showing would be
memory corruption, but then we'll likely have bigger problems anyway. No ?

> 	

-- 
Damien Le Moal
Western Digital Research


  reply	other threads:[~2022-11-02  9:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-31  3:00 [PATCH 0/2] zonefs fixes Damien Le Moal
2022-10-31  3:00 ` [PATCH 1/2] zonefs: fix zone report size in __zonefs_io_error() Damien Le Moal
2022-11-02  9:28   ` Johannes Thumshirn
2022-11-02  9:44     ` Damien Le Moal [this message]
2022-11-02 10:11       ` Johannes Thumshirn
2022-11-02 10:49         ` Damien Le Moal
2022-11-04  0:30     ` Damien Le Moal
2022-10-31  3:00 ` [PATCH 2/2] zonefs: Remove to_attr() helper function Damien Le Moal
2022-11-02  9:24   ` Johannes Thumshirn

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=af8953db-cdb2-507c-1c54-88593fae4b74@opensource.wdc.com \
    --to=damien.lemoal@opensource.wdc.com \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).