From b534884342da3a67226f43ccd429e7f2a231ae1e Mon Sep 17 00:00:00 2001 From: Damien Le Moal Date: Thu, 4 Aug 2022 16:14:43 +0800 Subject: [PATCH] zonefs: Clear inode information flags on inode creation stable inclusion from stable-v5.10.114 commit 5fef6df2731f7a044fc16e6a842b3deb0ee9bc42 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I5IY1V Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=5fef6df2731f7a044fc16e6a842b3deb0ee9bc42 -------------------------------- commit 694852ead287a3433126e7ebda397b242dc99624 upstream. 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: Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Reviewed-by: Chaitanya Kulkarni Reviewed-by: Hans Holmberg Signed-off-by: Greg Kroah-Hartman Signed-off-by: Zheng Zengkai Acked-by: Xie XiuQi --- fs/zonefs/super.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c index b8d566cf58af..26691bab0e06 100644 --- a/fs/zonefs/super.c +++ b/fs/zonefs/super.c @@ -1163,6 +1163,7 @@ static struct inode *zonefs_alloc_inode(struct super_block *sb) mutex_init(&zi->i_truncate_mutex); init_rwsem(&zi->i_mmap_sem); zi->i_wr_refcnt = 0; + zi->i_flags = 0; return &zi->i_vnode; } -- GitLab