mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
fuse: check s_root when destroying sb
commit d534d31d6a upstream.
Checking "fm" works because currently sb->s_fs_info is cleared on error
paths; however, sb->s_root is what generic_shutdown_super() checks to
determine whether the sb was fully initialized or not.
This change will allow cleanup of sb setup error paths.
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Yang Bo <yb203166@antfin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
6d0d67b05f
commit
0078a1667c
@@ -1596,7 +1596,7 @@ static void fuse_kill_sb_blk(struct super_block *sb)
|
|||||||
struct fuse_mount *fm = get_fuse_mount_super(sb);
|
struct fuse_mount *fm = get_fuse_mount_super(sb);
|
||||||
bool last;
|
bool last;
|
||||||
|
|
||||||
if (fm) {
|
if (sb->s_root) {
|
||||||
last = fuse_mount_remove(fm);
|
last = fuse_mount_remove(fm);
|
||||||
if (last)
|
if (last)
|
||||||
fuse_conn_destroy(fm);
|
fuse_conn_destroy(fm);
|
||||||
|
|||||||
@@ -1399,7 +1399,7 @@ static void virtio_kill_sb(struct super_block *sb)
|
|||||||
bool last;
|
bool last;
|
||||||
|
|
||||||
/* If mount failed, we can still be called without any fc */
|
/* If mount failed, we can still be called without any fc */
|
||||||
if (fm) {
|
if (sb->s_root) {
|
||||||
last = fuse_mount_remove(fm);
|
last = fuse_mount_remove(fm);
|
||||||
if (last)
|
if (last)
|
||||||
virtio_fs_conn_destroy(fm);
|
virtio_fs_conn_destroy(fm);
|
||||||
|
|||||||
Reference in New Issue
Block a user