All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Pankaj Raghav <p.raghav@samsung.com>
Cc: javier.gonz@samsung.com, Damien.LeMoal@wdc.com,
	mcgrof@kernel.org, pankydev8@gmail.com,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH v2] libf2fs: don't allow mkfs / fsck on non power-of-2 zoned devices
Date: Wed, 13 Apr 2022 12:45:55 -0700	[thread overview]
Message-ID: <Ylcoc0mfEIUS0e5Q@google.com> (raw)
In-Reply-To: <6f508044-5329-f864-3879-c42a59d52366@samsung.com>

On 04/13, Pankaj Raghav wrote:
> Hi Jaegeuk,
> 
> On 2022-04-13 19:03, Jaegeuk Kim wrote
> >> @@ -882,6 +882,11 @@ static int open_check_fs(char *path, int flag)
> >>  	return open(path, O_RDONLY | flag);
> >>  }
> >>  
> >> +static int is_power_of_2(unsigned long n)
> > 
> > So, this needs to check 2MB alignment only?
> > 
> As I explained in the v1 thread, zoned support for f2fs assumes po2 zone
> sizes. For e.g.,
> static int __f2fs_issue_discard_zone(struct f2fs_sb_info *sbi,
> 		struct block_device *bdev, block_t blkstart, block_t blklen)
> {
> 	sector_t sector, nr_sects;
> 	block_t lblkstart = blkstart;
> 	int devi = 0;
> ...
> ...
> 		// Assumes zone sectors to be po2

Well, I think this will be aligned to 2MB, if the device gives NPO2? IOWs, this
is just checking the granularity, not PO2.

> 		if (sector & (bdev_zone_sectors(bdev) - 1) ||
> 				nr_sects != bdev_zone_sectors(bdev)) {
> 			f2fs_err(sbi, "(%d) %s: Unaligned zone reset attempted (block %x + %x)",
> 				 devi, sbi->s_ndevs ? FDEV(devi).path : "",
> 				 blkstart, blklen);
> 			return -EIO;
> 		}
> 
> ...
> }
> 
> So until non power of 2 zoned devices are supported in block layer and
> f2fs, it is safer to reject non power of 2 devices during mkfs time. I
> hope it clarifies.


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

  reply	other threads:[~2022-04-13 19:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220413122941eucas1p1ec05e8e8dfe2baf451fcb549d60fda35@eucas1p1.samsung.com>
2022-04-13 12:29 ` [f2fs-dev] [PATCH v2] libf2fs: don't allow mkfs / fsck on non power-of-2 zoned devices Pankaj Raghav
2022-04-13 17:03   ` Jaegeuk Kim
2022-04-13 17:53     ` Pankaj Raghav
2022-04-13 19:45       ` Jaegeuk Kim [this message]
2022-04-19  8:02         ` Pankaj Raghav
2022-04-19 23:07           ` Jaegeuk Kim
2022-04-20  6:48             ` Pankaj Raghav
2022-04-20  8:30             ` Pankaj Raghav
2022-04-20 10:45   ` Chao Yu

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=Ylcoc0mfEIUS0e5Q@google.com \
    --to=jaegeuk@kernel.org \
    --cc=Damien.LeMoal@wdc.com \
    --cc=javier.gonz@samsung.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=mcgrof@kernel.org \
    --cc=p.raghav@samsung.com \
    --cc=pankydev8@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.