History

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.

Damien Le Moal committed 4 years ago

Commit 96eca141 parent a2a513b1 file · +5 −2Browse files

Unified · Split

fs/zonefs/super.c+5−2
@@ -1085,7 +1085,8 @@ static int zonefs_seq_file_write_open(struct inode *inode) · 1084 unmodified lines
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) · 693 unmodified lines
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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t