[RHEL7,COMMIT] fuse: pcs_kio cancel requests after fused crash

Submitted by Konstantin Khorenko on May 8, 2018, 8:53 a.m.

Details

Message ID 201805080853.w488rkHv000630@finist_ce7.work
State New
Series "fuse: pcs_kio cancel requests after fused crash"
Headers show

Commit Message

Konstantin Khorenko May 8, 2018, 8:53 a.m.
The commit is pushed to "branch-rh7-3.10.0-693.21.1.vz7.47.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.21.1.vz7.47.4
------>
commit ef25a7a7979b0fd31f9b0fe6637b1eae8df37bf2
Author: Dmitry Monakhov <dmonakhov@openvz.org>
Date:   Tue May 8 11:53:46 2018 +0300

    fuse: pcs_kio cancel requests after fused crash
    
    Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
    
    khorenko@: "return" after request completion added.
---
 fs/fuse/kio/pcs/pcs_cluster.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/kio/pcs/pcs_cluster.c b/fs/fuse/kio/pcs/pcs_cluster.c
index b995135a35cc..fe1ac6df58bd 100644
--- a/fs/fuse/kio/pcs/pcs_cluster.c
+++ b/fs/fuse/kio/pcs/pcs_cluster.c
@@ -393,8 +393,19 @@  static void pcs_cc_process_ireq_ioreq(struct pcs_int_request *ireq)
 
 static void ireq_process_(struct pcs_int_request *ireq)
 {
+	struct fuse_conn * fc = container_of(ireq->cc, struct pcs_fuse_cluster, cc)->fc;
+
+
 	TRACE("enter " DENTRY_FMT " type=%u\n", DENTRY_ARGS(ireq->dentry), ireq->type);
 
+	/* If fuse connection is dead we shoud fail all requests in flight */
+	if (unlikely(!fc->initialized || fc->conn_error)) {
+		ireq->flags |= IREQ_F_FATAL;
+		pcs_set_local_error(&ireq->error, PCS_ERR_UNAVAIL);
+		ireq_complete(ireq);
+		return;
+	}
+
 	switch (ireq->type) {
 	case PCS_IREQ_NOOP:
 		ireq_complete(ireq);