diff mbox series

[2/7] fuse: Move flush_bg_queue() up in fuse_abort_conn()

Message ID 154754756520.4244.2632848231069869374.stgit@localhost.localdomain (mailing list archive)
State New, archived
Headers show
Series fuse: Improve disconnect scheme and avoid taking fpq->lock on hot paths | expand

Commit Message

Kirill Tkhai Jan. 15, 2019, 10:19 a.m. UTC
Preparation for next patches.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 fs/fuse/dev.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 8a63e52785e9..dd8f019447a9 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -2191,6 +2191,9 @@  void fuse_abort_conn(struct fuse_conn *fc)
 		/* Background queuing checks fc->connected under bg_lock */
 		spin_lock(&fc->bg_lock);
 		fc->connected = 0;
+		fc->blocked = 0;
+		fc->max_background = UINT_MAX;
+		flush_bg_queue(fc);
 		spin_unlock(&fc->bg_lock);
 
 		fuse_set_initialized(fc);
@@ -2215,11 +2218,6 @@  void fuse_abort_conn(struct fuse_conn *fc)
 						      &to_end);
 			spin_unlock(&fpq->lock);
 		}
-		spin_lock(&fc->bg_lock);
-		fc->blocked = 0;
-		fc->max_background = UINT_MAX;
-		flush_bg_queue(fc);
-		spin_unlock(&fc->bg_lock);
 
 		spin_lock(&fiq->waitq.lock);
 		fiq->connected = 0;