[Devel] [PATCH RHEL7 COMMIT] fuse kio: never ignore fuse_req error during PCS_IOC_GETMAP

Konstantin Khorenko khorenko at virtuozzo.com
Sat Nov 24 18:01:00 MSK 2018


The commit is pushed to "branch-rh7-3.10.0-862.20.2.vz7.73.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-862.20.2.vz7.73.8
------>
commit ce803d074c40ac88744845a511ff41252992968e
Author: Anton Nefedov <anton.nefedov at virtuozzo.com>
Date:   Sat Nov 24 18:00:58 2018 +0300

    fuse kio: never ignore fuse_req error during PCS_IOC_GETMAP
    
    if ioctl returns error its result cannot be interpreted. Propagate
    the error into the resulting pcs_ioc_getmap structure unconditionally.
    
    Since VERSION 1.2 fused properly sets fuse_ioctl_out::result (which passed
    into work->status)
    
    Signed-off-by: Anton Nefedov <anton.nefedov at virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_fuse_kdirect.c | 6 ++++--
 fs/fuse/kio/pcs/pcs_ioctl.h        | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
index d1d3f7f4a256..3b1d819792b2 100644
--- a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
+++ b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
@@ -425,8 +425,10 @@ static void fuse_complete_map_work(struct work_struct *w)
 
 	BUG_ON(!m);
 	BUG_ON(!omap);
-	pcs_copy_error_cond(&omap->error, &work->status);
-	if (omap->cs_cnt > MAX_CS_CNT) {
+
+	if (pcs_if_error(&work->status)) {
+		pcs_copy_error(&omap->error, &work->status);
+	} else if (omap->cs_cnt > MAX_CS_CNT) {
 		printk("Corrupted cs_cnt from userspace");
 		pcs_set_local_error(&omap->error, PCS_ERR_PROTOCOL);
 	}
diff --git a/fs/fuse/kio/pcs/pcs_ioctl.h b/fs/fuse/kio/pcs/pcs_ioctl.h
index b36bc653b210..5cf40e35f881 100644
--- a/fs/fuse/kio/pcs/pcs_ioctl.h
+++ b/fs/fuse/kio/pcs/pcs_ioctl.h
@@ -10,7 +10,7 @@
 #include "pcs_map.h"
 #include "pcs_rpc.h"
 
-#define PCS_FAST_PATH_VERSION ((PCS_FAST_PATH_VERSION_T){1, 1})
+#define PCS_FAST_PATH_VERSION ((PCS_FAST_PATH_VERSION_T){1, 2})
 
 #define PCS_FUSE_INO_SPECIAL_ ((unsigned long long)-0x1000)
 



More information about the Devel mailing list