zonefs: Fix file size of zones in full condition
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Wed, 17 Feb 2021 09:58:11 +0000 (18:58 +0900)
committerDamien Le Moal <damien.lemoal@wdc.com>
Wed, 17 Feb 2021 23:36:40 +0000 (08:36 +0900)
commit059c01039c0185dbee7ed080f1f2bd22cb1e4dab
treeead159acff3dce3461a20a432c05c9768f973e48
parent62ab1aadcccd037a7ced4ed99b4d46d2b4190183
zonefs: Fix file size of zones in full condition

Per ZBC/ZAC/ZNS specifications, write pointers may not have valid values
when zones are in full condition. However, when zonefs mounts a zoned
block device, zonefs refers write pointers to set file size even when
the zones are in full condition. This results in wrong file size. To fix
this, refer maximum file size in place of write pointers for zones in
full condition.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Fixes: 8dcc1a9d90c1 ("fs: New zonefs file system")
Cc: <stable@vger.kernel.org> # 5.6+
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
fs/zonefs/super.c