Skip to content

Commit

Permalink
staging: erofs: set sb->s_root to NULL when failing from __getname()
Browse files Browse the repository at this point in the history
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: Chengguang Xu <cgxu519@gmail.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Chengguang Xu authored and Greg Kroah-Hartman committed May 20, 2019
1 parent 083a685 commit f2dcb88
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/staging/erofs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,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);
Expand Down

0 comments on commit f2dcb88

Please sign in to comment.