[Devel] [PATCH RHEL7 COMMIT] fs/fuse kio: skip iostat count for unknown req types

Konstantin Khorenko khorenko at virtuozzo.com
Fri May 31 22:19:38 MSK 2019


The commit is pushed to "branch-rh7-3.10.0-957.12.2.vz7.96.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.12.2.vz7.96.11
------>
commit 502154f16940ea7005e0900b129fcceaf48b47d0
Author: Pavel Butsykin <pbutsykin at virtuozzo.com>
Date:   Fri May 31 12:23:44 2019 +0300

    fs/fuse kio: skip iostat count for unknown req types
    
    There are still some number of response req types:
    PCS_CS_WRITE_ZERO_RESP
    PCS_CS_WRITE_HOLE_RESP
    PCS_CS_REPLICATEX_RESP
    PCS_CS_FIEMAP_RESP
    PCS_CS_MAP_PROP_RESP
    
    It makes no sense to count statistics for such requests, so for them the stat
    count will simply be skipped.
    
    https://pmc.acronis.com/browse/VSTOR-23620
    
    Signed-off-by: Pavel Butsykin <pbutsykin at virtuozzo.com>
    
    v2: don't move req_stat_entry() out of lock.
---
 fs/fuse/kio/pcs/fuse_stat.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/fuse/kio/pcs/fuse_stat.c b/fs/fuse/kio/pcs/fuse_stat.c
index 06be3c75240c..bc3879d33de9 100644
--- a/fs/fuse/kio/pcs/fuse_stat.c
+++ b/fs/fuse/kio/pcs/fuse_stat.c
@@ -654,7 +654,6 @@ struct fuse_val_stat *req_stat_entry(struct pcs_fuse_io_stat *io, u32 type)
 		default:
 			break;
 	}
-	WARN_ON_ONCE(1);
 	return NULL;
 }
 
@@ -665,8 +664,11 @@ static void fuse_iostat_count(struct pcs_fuse_io_stat_sync *iostat,
 
 	write_seqlock(&iostat->seqlock);
 	se = req_stat_entry(iostat->CURR(iostat), type);
-	BUG_ON(!se);
+	if (!se)
+		goto out_unlock;
+
 	fuse_val_stat_update(se, size);
+out_unlock:
 	write_sequnlock(&iostat->seqlock);
 }
 



More information about the Devel mailing list