Skip to content

Commit 96eca14

Browse files
author
Damien Le Moal
committed
zonefs: Do not ignore explicit_open with active zone limit
A zoned device may have no limit on the number of open zones but may have a limit on the number of active zones it can support. In such case, the explicit_open mount option should not be ignored to ensure that the open() system call activates the zone with an explicit zone open command, thus guaranteeing that the zone can be written. Enforce this by ignoring the explicit_open mount option only for devices that have both the open and active zone limits equal to 0. Fixes: 87c9ce3 ("zonefs: Add active seq file accounting") Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
1 parent a2a513b commit 96eca14

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

fs/zonefs/super.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,8 @@ static int zonefs_seq_file_write_open(struct inode *inode)
10851085

10861086
if (sbi->s_mount_opts & ZONEFS_MNTOPT_EXPLICIT_OPEN) {
10871087

1088-
if (wro > sbi->s_max_wro_seq_files) {
1088+
if (sbi->s_max_wro_seq_files
1089+
&& wro > sbi->s_max_wro_seq_files) {
10891090
atomic_dec(&sbi->s_wro_seq_files);
10901091
ret = -EBUSY;
10911092
goto unlock;
@@ -1785,8 +1786,10 @@ static int zonefs_fill_super(struct super_block *sb, void *data, int silent)
17851786
blkdev_nr_zones(sb->s_bdev->bd_disk));
17861787

17871788
if (!sbi->s_max_wro_seq_files &&
1789+
!sbi->s_max_active_seq_files &&
17881790
sbi->s_mount_opts & ZONEFS_MNTOPT_EXPLICIT_OPEN) {
1789-
zonefs_info(sb, "No open zones limit. Ignoring explicit_open mount option\n");
1791+
zonefs_info(sb,
1792+
"No open and active zone limits. Ignoring explicit_open mount option\n");
17901793
sbi->s_mount_opts &= ~ZONEFS_MNTOPT_EXPLICIT_OPEN;
17911794
}
17921795

0 commit comments

Comments
 (0)