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

Submitted by Konstantin Khorenko on May 31, 2019, 7:19 p.m.

Details

Message ID 201905311919.x4VJJaT0012714@finist-ce7.sw.ru
State New
Series "fs/fuse kio: skip iostat count for unknown req types"
Headers show

Commit Message

Konstantin Khorenko May 31, 2019, 7:19 p.m.
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@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@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(-)

Patch hide | download patch | download mbox

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);
 }