Commit 41fa7077 authored by Chengguang Xu's avatar Chengguang Xu Committed by Greg Kroah-Hartman

staging: erofs: set sb->s_root to NULL when failing from __getname()

[ Upstream commit f2dcb884 ]

Set sb->s_root to NULL when failing from __getname(),
so that we can avoid double dput and unnecessary operations
in generic_shutdown_super().
Signed-off-by: default avatarChengguang Xu <cgxu519@gmail.com>
Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Reviewed-by: default avatarGao Xiang <gaoxiang25@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 83907b7c
......@@ -459,6 +459,7 @@ static int erofs_read_super(struct super_block *sb,
*/
err_devname:
dput(sb->s_root);
sb->s_root = NULL;
err_iget:
#ifdef EROFS_FS_HAS_MANAGED_CACHE
iput(sbi->managed_cache);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment