zonefs: Clear inode information flags on inode creation
authorDamien Le Moal <damien.lemoal@opensource.wdc.com>
Tue, 12 Apr 2022 11:52:35 +0000 (20:52 +0900)
committerDamien Le Moal <damien.lemoal@opensource.wdc.com>
Wed, 20 Apr 2022 23:37:23 +0000 (08:37 +0900)
Ensure that the i_flags field of struct zonefs_inode_info is cleared to
0 when initializing a zone file inode, avoiding seeing the flag
ZONEFS_ZONE_OPEN being incorrectly set.

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: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Hans Holmberg <hans.holmberg@wdc.com>
fs/zonefs/super.c

index 3614c7834007dd0ea587f01778ee7c7b0460a4e6..75d8dabe08072b6479fa49bde05812d956bc6b95 100644 (file)
@@ -1142,6 +1142,7 @@ static struct inode *zonefs_alloc_inode(struct super_block *sb)
        inode_init_once(&zi->i_vnode);
        mutex_init(&zi->i_truncate_mutex);
        zi->i_wr_refcnt = 0;
+       zi->i_flags = 0;
 
        return &zi->i_vnode;
 }