On Tue Aug 26, 2025 at 9:11 AM JST, Shinichiro Kawasaki wrote: > On Aug 25, 2025 / 09:10, Bart Van Assche wrote: >> Hi, >> >> If I run blktests test zbd/009 on top of Jens' for-next branch >> (commit 6763582c1263 ("Merge branch 'block-6.17' into for-next")) then >> the test triggers a hang in btrfs_writepages(). The same test zbd/009 >> passes with older kernel versions (v6.16 and before). Other ZBD tests >> pass with the same kernel. Could this indicate a BTRFS regression? > > I hit the hang also, and identified the trigger commit 04147d8394e8 ("btrfs: > zoned: limit active zones to max_open_zones"), which is in the kernel tag > v6.17-rc3. Zoned btrfs requires max active zones limit of zoned block devices > to be at least 11 or greater. The commit applies the same requirement to > max_open_zones also. On the other hand, the default max_open_zones limit of > scsi_debug is 8. Hence the requirement is not met, and resulted in the hang. > > On the blktests side, I will post a patch soon to set max_open_zones limit > larger than 11. I expect the limitation of zoned-btrfs to be checked by mkfs or > mount to avoid confusions. As an additinal information, btrfs checks if the max_active_zones (or, max_open_zones) is equal to or larger than 8 to proceed the mount process. That number is correct when the btrfs is created with a single metadata profile. However, btrfs default to use DUP profile for metadata, and it consumes two zones per metadata block group, which requires more active zones. I'll refine mkfs and mount check to consider the profile information.