[RHEL7,COMMIT] fuse kio: Revert "fuse: Move FUSE_DESTROY request handling in conn_abort"

Submitted by Konstantin Khorenko on June 18, 2018, 10:02 a.m.

Details

Message ID 201806181002.w5IA2iVu020693@finist_ce7.work
State New
Headers show

Patch hide | download patch | download mbox

diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 96d6db217570..a958783ee113 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -2210,6 +2210,8 @@  void fuse_abort_conn(struct fuse_conn *fc)
 			list_splice_init(&fpq->processing, &to_end2);
 			spin_unlock(&fpq->lock);
 		}
+		if (fc->kio.op)
+			fc->kio.op->conn_abort(fc);
 
 		fc->max_background = UINT_MAX;
 		for_each_online_cpu(cpu)
@@ -2231,9 +2233,6 @@  void fuse_abort_conn(struct fuse_conn *fc)
 			request_end(fc, req);
 		}
 		end_requests(fc, &to_end2);
-
-		if (fc->kio.op)
-			fc->kio.op->conn_abort(fc);
 	} else {
 		spin_unlock(&fc->lock);
 	}
diff --git a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
index 797f07be7a82..af82b043f786 100644
--- a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
+++ b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
@@ -148,11 +148,9 @@  void kpcs_conn_abort(struct fuse_conn *fc)
 	if (!fc->kio.ctx)
 		return;
 
-	/* TODO: This is just a crunch, Conn cleanup requires sane locking */
-	kpcs_conn_fini(fc);
-	spin_lock(&fc->lock);
-	fc->kio.ctx = NULL;
-	spin_unlock(&fc->lock);
+	//pcs_cluster_fini((struct pcs_fuse_cluster *) fc->kio.ctx);
+	printk("%s TODO: implement this method\n", __FUNCTION__);
+
 }
 
 static int kpcs_probe(struct fuse_conn *fc, char *name)
@@ -1004,6 +1002,15 @@  static int kpcs_req_send(struct fuse_conn* fc, struct fuse_req *req, bool bg, bo
 
 	TRACE(" Enter req:%p op:%d end:%p bg:%d lk:%d\n", req, req->in.h.opcode, req->end, bg, lk);
 
+	/* TODO: This is just a crunch, Conn cleanup requires sane locking */
+	if (req->in.h.opcode == FUSE_DESTROY) {
+		kpcs_conn_fini(fc);
+		spin_lock(&fc->lock);
+		fc->kio.ctx = NULL;
+		spin_unlock(&fc->lock);
+		return 1;
+	}
+
 	if (!fi || !fi->private)
 		return 1;