1 From 73a3bcafe0242781b0991e2df5ab271b4aeb970e Mon Sep 17 00:00:00 2001
2 From: Chengguang Xu <cgxu519@gmail.com>
3 Date: Mon, 6 May 2019 19:01:02 +0800
4 Subject: staging: erofs: set sb->s_root to NULL when failing from __getname()
6 [ Upstream commit f2dcb8841e6b155da098edae09125859ef7e853d ]
8 Set sb->s_root to NULL when failing from __getname(),
9 so that we can avoid double dput and unnecessary operations
10 in generic_shutdown_super().
12 Signed-off-by: Chengguang Xu <cgxu519@gmail.com>
13 Reviewed-by: Chao Yu <yuchao0@huawei.com>
14 Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
15 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
16 Signed-off-by: Sasha Levin <sashal@kernel.org>
18 drivers/staging/erofs/super.c | 1 +
19 1 file changed, 1 insertion(+)
21 diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c
22 index 15c784fba879..c8981662a49b 100644
23 --- a/drivers/staging/erofs/super.c
24 +++ b/drivers/staging/erofs/super.c
25 @@ -459,6 +459,7 @@ static int erofs_read_super(struct super_block *sb,
31 #ifdef EROFS_FS_HAS_MANAGED_CACHE
32 iput(sbi->managed_cache);