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

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