]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-5.1/staging-erofs-set-sb-s_root-to-null-when-failing-fro.patch
fixes for 5.1
[thirdparty/kernel/stable-queue.git] / queue-5.1 / staging-erofs-set-sb-s_root-to-null-when-failing-fro.patch
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()
5
6 [ Upstream commit f2dcb8841e6b155da098edae09125859ef7e853d ]
7
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().
11
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>
17 ---
18 drivers/staging/erofs/super.c | 1 +
19 1 file changed, 1 insertion(+)
20
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,
26 */
27 err_devname:
28 dput(sb->s_root);
29 + sb->s_root = NULL;
30 err_iget:
31 #ifdef EROFS_FS_HAS_MANAGED_CACHE
32 iput(sbi->managed_cache);
33 --
34 2.20.1
35