lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240704214307.kyxivjkvshcqggt6@quentin>
Date: Thu, 4 Jul 2024 21:43:07 +0000
From: "Pankaj Raghav (Samsung)" <kernel@...kajraghav.com>
To: Mikulas Patocka <mpatocka@...hat.com>
Cc: Li Dong <lidong@...o.com>, Damien Le Moal <dlemoal@...nel.org>,
	Naohiro Aota <naohiro.aota@....com>,
	Johannes Thumshirn <jth@...nel.org>, Jens Axboe <axboe@...nel.dk>,
	Alasdair Kergon <agk@...hat.com>, Mike Snitzer <snitzer@...nel.org>,
	"open list:DEVICE-MAPPER  (LVM)" <dm-devel@...ts.linux.dev>,
	open list <linux-kernel@...r.kernel.org>,
	opensource.kernel@...o.com, linux-fsdevel@...r.kernel.org,
	linux-block@...r.kernel.org
Subject: Re: Non-power-of-2 zone size (was: [PATCH] dm-table:fix zone
 block_device not aligned with zonesize)

> I grepped the kernel for bdev_zone_sectors and there are more assumptions 
> that bdev_zone_sectors is a power of 2.
> 
> drivers/md/dm-zone.c:           sector_t mask = bdev_zone_sectors(disk->part0) - 1
> drivers/nvme/target/zns.c:      if (get_capacity(bd_disk) & (bdev_zone_sectors(ns->bdev) - 1))
> drivers/nvme/target/zns.c:      if (sect & (bdev_zone_sectors(req->ns->bdev) - 1)) {
> fs/zonefs/super.c:      sbi->s_zone_sectors_shift = ilog2(bdev_zone_sectors(sb->s_bdev));
> fs/btrfs/zoned.c:       return (sector_t)zone_number << ilog2(bdev_zone_sectors(bdev));
> fs/btrfs/zoned.c:	zone_info->zone_size_shift = ilog2(zone_info->zone_size);
> include/linux/blkdev.h: return sector & (bdev_zone_sectors(bdev) - 1);
> fs/f2fs/super.c:	if (nr_sectors & (zone_sectors - 1))
> 
> So, if we want to support non-power-of-2 zone size, we need some 
> systematic fix. Now it appears that Linux doesn't even attempt to support 
> disks non-power-of-2 zone size.

FYI, I sent the patches to add non-power-of-2 zone size support to the
block layer [0] a long time back. Sadly, it was not finally merged upstream.
Android wanted this support, so for now it is in the Android tree.

-- 
Pankaj Raghav

[0] https://lore.kernel.org/linux-block/20220923173618.6899-1-p.raghav@samsung.com/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ