[Devel] [PATCH RHEL7 COMMIT] fuse kio: Fallback to plain fuse in case of version mismatch

Konstantin Khorenko khorenko at virtuozzo.com
Tue Oct 9 11:50:45 MSK 2018


The commit is pushed to "branch-rh7-3.10.0-862.14.4.vz7.72.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-862.14.4.vz7.72.4
------>
commit 4722d7cb313b38107803b9f6e23ab3e1f3dd8baa
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Tue Oct 9 11:50:42 2018 +0300

    fuse kio: Fallback to plain fuse in case of version mismatch
    
    In case of such the problem, not assign fc->kio.op,
    and just use the fallback mode.
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
    Reviewed-by: Pavel Butsykin <pbutsykin at virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_fuse_kdirect.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
index fb7e4fc16ea8..768da2800138 100644
--- a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
+++ b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
@@ -70,22 +70,22 @@ static void process_pcs_init_reply(struct fuse_conn *fc, struct fuse_req *req)
 	struct fuse_ioctl_out *arg = &req->misc.ioctl.out;
 	struct	pcs_ioc_init_kdirect *info = req->out.args[1].value;
 
-	if (req->out.h.error || arg->result) {
+	if ((req->out.h.error == -EPROTONOSUPPORT && !arg->result) ||
+	    info->version.major != PCS_FAST_PATH_VERSION.major ||
+	    info->version.minor != PCS_FAST_PATH_VERSION.minor) {
+		pr_err("kio_pcs: version missmatch: must be %u.%u. "
+		       "Fallback to plain fuse\n",
+		       PCS_FAST_PATH_VERSION.major,
+		       PCS_FAST_PATH_VERSION.minor);
+		fc->flags &= ~FUSE_KDIRECT_IO;
+		goto out;
+	} else if (req->out.h.error || arg->result) {
 		printk("Fail to initialize has_kdirect {%d,%d}\n",
 		       req->out.h.error, arg->result);
 		fc->conn_error = 1;
 		goto out;
 	}
 
-	if (info->version.major != PCS_FAST_PATH_VERSION.major ||
-	    info->version.minor != PCS_FAST_PATH_VERSION.minor) {
-		pr_err("kio_pcs: version missmatch: must be %u.%u\n",
-			PCS_FAST_PATH_VERSION.major,
-			PCS_FAST_PATH_VERSION.minor);
-		fc->conn_error = 1;
-		goto out;
-	}
-
 	pfc = kvmalloc(sizeof(*pfc), GFP_KERNEL);
 	if (!pfc) {
 		fc->conn_error = 1;



More information about the Devel mailing list