]> git.baikalelectronics.ru Git - kernel.git/commit
zonfs: Fix handling of read-only zones
authorDamien Le Moal <damien.lemoal@wdc.com>
Fri, 20 Mar 2020 12:36:54 +0000 (21:36 +0900)
committerDamien Le Moal <damien.lemoal@wdc.com>
Wed, 25 Mar 2020 02:28:26 +0000 (11:28 +0900)
commitccad6fa9593313c6953b35e5f24d1ba0a6dd85d9
tree7dd69481e52106a8dceeaad3ee2157d34e640ce7
parent1ba026dfa30628f0b29986b85e04f90d3da0d177
zonfs: Fix handling of read-only zones

The write pointer of zones in the read-only consition is defined as
invalid by the SCSI ZBC and ATA ZAC specifications. It is thus not
possible to determine the correct size of a read-only zone file on
mount. Fix this by handling read-only zones in the same manner as
offline zones by disabling all accesses to the zone (read and write)
and initializing the inode size of the read-only zone to 0).

For zones found to be in the read-only condition at runtime, only
disable write access to the zone and keep the size of the zone file to
its last updated value to allow the user to recover previously written
data.

Also fix zonefs documentation file to reflect this change.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Documentation/filesystems/zonefs.txt
fs/zonefs/super.c