[Devel,vz7,08/46] fuse: call fuse_abort_conn() in dev release

Submitted by Maxim Patlasov on March 25, 2017, 2:14 a.m.

Details

Message ID 149040808414.25341.13543229759144755799.stgit@maxim-thinkpad
State New
Series "fuse: add multi-threading support"
Headers show

Commit Message

Maxim Patlasov March 25, 2017, 2:14 a.m.
Backport from ml:

commit ccd0a0bd16ff01bb27bacbeb2e0e4983dc299502
Author: Miklos Szeredi <mszeredi@suse.cz>
Date:   Wed Jul 1 16:25:57 2015 +0200

    fuse: call fuse_abort_conn() in dev release

    fuse_abort_conn() does all the work done by fuse_dev_release() and more.
    "More" consists of:

            end_io_requests(fc);
            wake_up_all(&fc->waitq);
            kill_fasync(&fc->fasync, SIGIO, POLL_IN);

    All of which should be no-op (WARN_ON's added).

    Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
    Reviewed-by: Ashish Samant <ashish.samant@oracle.com>

Signed-off-by: Maxim Patlasov <mpatlasov@virtuozzo.com>
---
 fs/fuse/dev.c |   11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 5e7f812..d50f48f 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -2205,14 +2205,9 @@  int fuse_dev_release(struct inode *inode, struct file *file)
 {
 	struct fuse_conn *fc = fuse_get_conn(file);
 	if (fc) {
-		spin_lock(&fc->lock);
-		fc->connected = 0;
-		fc->blocked = 0;
-		fuse_set_initialized(fc);
-		end_queued_requests(fc);
-		end_polls(fc);
-		wake_up_all(&fc->blocked_waitq);
-		spin_unlock(&fc->lock);
+		WARN_ON(!list_empty(&fc->io));
+		WARN_ON(fc->fasync != NULL);
+		fuse_abort_conn(fc);
 		fuse_conn_put(fc);
 	}