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.
Unified · Split
| @@ -1085,7 +1085,8 @@ static int zonefs_seq_file_write_open(struct inode *inode) · 1084 unmodified lines | ||
| 1085 | 1085 | |
| 1086 | 1086 | if (sbi->s_mount_opts & ZONEFS_MNTOPT_EXPLICIT_OPEN) { |
| 1087 | 1087 | |
| 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) { | |
| 1089 | 1090 | atomic_dec(&sbi->s_wro_seq_files); |
| 1090 | 1091 | ret = -EBUSY; |
| 1091 | 1092 | goto unlock; |
| @@ -1785,8 +1786,10 @@ static int zonefs_fill_super(struct super_block *sb, void *data, int silent) · 693 unmodified lines | ||
| 1785 | 1786 | blkdev_nr_zones(sb->s_bdev->bd_disk)); |
| 1786 | 1787 | |
| 1787 | 1788 | if (!sbi->s_max_wro_seq_files && |
| 1789 | + !sbi->s_max_active_seq_files && | |
| 1788 | 1790 | 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"); | |
| 1790 | 1793 | sbi->s_mount_opts &= ~ZONEFS_MNTOPT_EXPLICIT_OPEN; |
| 1791 | 1794 | } |
| 1792 | 1795 | |