diff options
author | 2022-04-12 17:41:37 +0900 | |
---|---|---|
committer | 2022-04-21 08:39:20 +0900 | |
commit | 1da18a296f5ba4f99429e62a7cf4fdbefa598902 (patch) | |
tree | 510ac1b4156e62453275655bfb3a657b28c31605 /fs/sysv | |
parent | zonefs: Clear inode information flags on inode creation (diff) | |
download | linux-1da18a296f5ba4f99429e62a7cf4fdbefa598902.tar.gz linux-1da18a296f5ba4f99429e62a7cf4fdbefa598902.tar.bz2 linux-1da18a296f5ba4f99429e62a7cf4fdbefa598902.zip |
zonefs: Fix management of open zones
The mount option "explicit_open" manages the device open zone
resources to ensure that if an application opens a sequential file for
writing, the file zone can always be written by explicitly opening
the zone and accounting for that state with the s_open_zones counter.
However, if some zones are already open when mounting, the device open
zone resource usage status will be larger than the initial s_open_zones
value of 0. Ensure that this inconsistency does not happen by closing
any sequential zone that is open when mounting.
Furthermore, with ZNS drives, closing an explicitly open zone that has
not been written will change the zone state to "closed", that is, the
zone will remain in an active state. Since this can then cause failures
of explicit open operations on other zones if the drive active zone
resources are exceeded, we need to make sure that the zone is not
active anymore by resetting it instead of closing it. To address this,
zonefs_zone_mgmt() is modified to change a REQ_OP_ZONE_CLOSE request
into a REQ_OP_ZONE_RESET for sequential zones that have not been
written.
Fixes: b5c00e975779 ("zonefs: open/close zone on file open/close")
Cc: <stable@vger.kernel.org>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Hans Holmberg <hans.holmberg@wdc.com>
Diffstat (limited to 'fs/sysv')
0 files changed, 0 insertions, 0 deletions