Commit bbd99797973f2cebd905bf6469ce08b531ab258f
1 parent
fea7a08acb
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
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>
Showing 1 changed file with 7 additions and 5 deletions Side-by-side Diff
fs/fuse/inode.c
... | ... | @@ -367,11 +367,6 @@ |
367 | 367 | wake_up_all(&fc->waitq); |
368 | 368 | wake_up_all(&fc->blocked_waitq); |
369 | 369 | 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); | |
375 | 370 | } |
376 | 371 | EXPORT_SYMBOL_GPL(fuse_conn_kill); |
377 | 372 | |
378 | 373 | |
... | ... | @@ -380,7 +375,14 @@ |
380 | 375 | struct fuse_conn *fc = get_fuse_conn_super(sb); |
381 | 376 | |
382 | 377 | fuse_send_destroy(fc); |
378 | + | |
383 | 379 | 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 | + | |
384 | 386 | fuse_conn_put(fc); |
385 | 387 | } |
386 | 388 |