Commit d534d31d authored by Miklos Szeredi's avatar Miklos Szeredi
Browse files

fuse: check s_root when destroying sb



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: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent 519d8195
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1747,7 +1747,7 @@ static void fuse_sb_destroy(struct super_block *sb)
	struct fuse_mount *fm = get_fuse_mount_super(sb);
	bool last;

	if (fm) {
	if (sb->s_root) {
		last = fuse_mount_remove(fm);
		if (last)
			fuse_conn_destroy(fm);
+1 −1
Original line number Diff line number Diff line
@@ -1394,7 +1394,7 @@ static void virtio_kill_sb(struct super_block *sb)
	bool last;

	/* If mount failed, we can still be called without any fc */
	if (fm) {
	if (sb->s_root) {
		last = fuse_mount_remove(fm);
		if (last)
			virtio_fs_conn_destroy(fm);