Skip to content

Commit bbd9979

Browse files
author
Miklos Szeredi
committed
cuse: fix fuse_conn_kill()
fuse_conn_kill() removed fc->entry, called fuse_ctl_remove_conn() and fuse_bdi_destroy(). None of which is appropriate for cuse cleanup. The fuse_ctl_remove_conn() decrements the nlink on the control filesystem, which is totally bogus. The others are harmless but unnecessary. So move these out from fuse_conn_kill() to fuse_put_super() where they belong. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
1 parent fea7a08 commit bbd9979

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

‎fs/fuse/inode.c‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -367,11 +367,6 @@ void fuse_conn_kill(struct fuse_conn *fc)
367367
wake_up_all(&fc->waitq);
368368
wake_up_all(&fc->blocked_waitq);
369369
wake_up_all(&fc->reserved_req_waitq);
370-
mutex_lock(&fuse_mutex);
371-
list_del(&fc->entry);
372-
fuse_ctl_remove_conn(fc);
373-
mutex_unlock(&fuse_mutex);
374-
fuse_bdi_destroy(fc);
375370
}
376371
EXPORT_SYMBOL_GPL(fuse_conn_kill);
377372

@@ -380,7 +375,14 @@ static void fuse_put_super(struct super_block *sb)
380375
struct fuse_conn *fc = get_fuse_conn_super(sb);
381376

382377
fuse_send_destroy(fc);
378+
383379
fuse_conn_kill(fc);
380+
mutex_lock(&fuse_mutex);
381+
list_del(&fc->entry);
382+
fuse_ctl_remove_conn(fc);
383+
mutex_unlock(&fuse_mutex);
384+
fuse_bdi_destroy(fc);
385+
384386
fuse_conn_put(fc);
385387
}
386388

0 commit comments

Comments
 (0)