On 11/10/25 16:22, Yongpeng Yang wrote:
> From: Yongpeng Yang <[email protected]>
> 
> When emulating a ZNS SSD on qemu with zoned.max_open set to 0, the
> F2FS can still be mounted successfully. The sysfs entry shows
> sbi->max_open_zones as UINT_MAX.
> 
> root@fedora-vm:~# cat /sys/block/nvme0n1/queue/zoned
> host-managed
> root@fedora-vm:~# cat /sys/block/nvme0n1/queue/max_open_zones
> 0
> root@fedora-vm:~# mkfs.f2fs -m -c /dev/nvme0n1 /dev/vda
> root@fedora-vm:~# mount /dev/vda /mnt/f2fs/
> root@fedora-vm:~# cat /sys/fs/f2fs/vda/max_open_zones
> 4294967295
> 
> The root cause is that sbi->max_open_zones is initialized to UINT_MAX
> and only updated when the device’s max_open_zones is greater than 0.
> However, both the scsi driver (sd_zbc_read_zones may assigns 0 to
> device's max_open_zones) and the nvme driver (nvme_query_zone_info don't
> check max_open_zones) allow max_open_zones to be 0.
> 
> This patch fixes the issue by preventing mounting on zoned SSDs when
> max_open_zones is 0, while still allowing SMR HDDs to be mounted.
> init_blkz_info() is only called by f2fs_scan_devices(), and the
> blkzoned feature has already been checked there. So, this patch also
> remove redundant zoned device checks.
> 
> Signed-off-by: Yongpeng Yang <[email protected]>

Reviewed-by: Chao Yu <[email protected]>

Thanks,


_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to