diff options
author | Damien Le Moal <damien.lemoal@opensource.wdc.com> | 2022-11-21 16:29:37 +0900 |
---|---|---|
committer | Damien Le Moal <damien.lemoal@opensource.wdc.com> | 2022-11-25 17:01:22 +0900 |
commit | db58653ce0c7cf4d155727852607106f890005c0 (patch) | |
tree | 4248dbc5acc984c73f4bc2ae8de017949686fad3 /fs/zonefs/zonefs.h | |
parent | 4e45886956a20942800259f326a04417292ae314 (diff) |
zonefs: Fix active zone accounting
If a file zone transitions to the offline or readonly state from an
active state, we must clear the zone active flag and decrement the
active seq file counter. Do so in zonefs_account_active() using the new
zonefs inode flags ZONEFS_ZONE_OFFLINE and ZONEFS_ZONE_READONLY. These
flags are set if necessary in zonefs_check_zone_condition() based on the
result of report zones operation after an IO error.
Fixes: 87c9ce3ffec9 ("zonefs: Add active seq file accounting")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Diffstat (limited to 'fs/zonefs/zonefs.h')
-rw-r--r-- | fs/zonefs/zonefs.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/zonefs/zonefs.h b/fs/zonefs/zonefs.h index 4b3de66c3233..1dbe78119ff1 100644 --- a/fs/zonefs/zonefs.h +++ b/fs/zonefs/zonefs.h @@ -39,8 +39,10 @@ static inline enum zonefs_ztype zonefs_zone_type(struct blk_zone *zone) return ZONEFS_ZTYPE_SEQ; } -#define ZONEFS_ZONE_OPEN (1 << 0) -#define ZONEFS_ZONE_ACTIVE (1 << 1) +#define ZONEFS_ZONE_OPEN (1U << 0) +#define ZONEFS_ZONE_ACTIVE (1U << 1) +#define ZONEFS_ZONE_OFFLINE (1U << 2) +#define ZONEFS_ZONE_READONLY (1U << 3) /* * In-memory inode data. |