zonefs: Do not ignore explicit_open with active zone limit
authorDamien Le Moal <damien.lemoal@opensource.wdc.com>
Thu, 2 Jun 2022 12:33:25 +0000 (21:33 +0900)
committerDamien Le Moal <damien.lemoal@opensource.wdc.com>
Wed, 8 Jun 2022 06:38:44 +0000 (15:38 +0900)
commit96eca145cb51f4e0132a3ea8066dfc6fdf75f24a
tree7bb705027e2513d25ca5ab1cdfbbc3a2b731877b
parenta2a513be7139b279f1b5b2cee59c6c4950c34346
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.

Fixes: 87c9ce3ffec9 ("zonefs: Add active seq file accounting")
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/zonefs/super.c