[RHEL7,COMMIT] fs/fuse kio_pcs: mapped requests have map version preinitialized

Submitted by Konstantin Khorenko on June 25, 2018, 4:08 p.m.

Details

Message ID 201806251608.w5PG8KrE011253@finist_ce7.work
State New
Series "fs/fuse kio_pcs: mapped requests have map version preinitialized"
Headers show

Commit Message

Konstantin Khorenko June 25, 2018, 4:08 p.m.
The commit is pushed to "branch-rh7-3.10.0-693.21.1.vz7.50.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.21.1.vz7.50.15
------>
commit 30979baf08c90ff4a018437782140349ba4dc1cb
Author: Pavel Butsykin <pbutsykin@virtuozzo.com>
Date:   Thu Jun 21 20:16:43 2018 +0300

    fs/fuse kio_pcs: mapped requests have map version preinitialized
    
    It is recently introduced bug. New kind of corruptions is possible.
    
    (Backport from user-space 2d136eac).
    
    Signed-off-by: Alexey Kuznetsov <kuznet@virtuozzo.com>
    Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
    
    Note from kuznet@:
    Would not hurt to have texts in sync.
    But still IREQ_F_MAPPED is not used by kio, it is raid6 thing.
---
 fs/fuse/kio/pcs/pcs_map.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/kio/pcs/pcs_map.c b/fs/fuse/kio/pcs/pcs_map.c
index a3bf48a8ea93..f2ae087d5286 100644
--- a/fs/fuse/kio/pcs/pcs_map.c
+++ b/fs/fuse/kio/pcs/pcs_map.c
@@ -2308,7 +2308,7 @@  void map_submit(struct pcs_map_entry * m, struct pcs_int_request *ireq)
 		struct pcs_cs_list *csl = NULL;
 
 		spin_lock(&m->lock);
-		if (ireq->type == PCS_IREQ_IOCHUNK) {
+		if (ireq->type == PCS_IREQ_IOCHUNK && !(ireq->flags & IREQ_F_MAPPED)) {
 			ireq->iochunk.hbuf.map_version = m->version;
 			ireq->iochunk.hbuf.uid = ireq->iochunk.map->id;
 		}