[Devel] [PATCH rh7] fs/fuse kio: fix warning about possible noninitialized variables in possible do_show_cs_stats()

Konstantin Khorenko khorenko at virtuozzo.com
Thu May 30 11:40:24 MSK 2019


It's impossible to have none possible cpus, but gcc is not aware of it.

Fixes: 049aa5f3a22c fs/fuse kio: implement cs_stats statistics info

Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 fs/fuse/kio/pcs/fuse_stat.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/fuse/kio/pcs/fuse_stat.c b/fs/fuse/kio/pcs/fuse_stat.c
index 1b44793d25f8..542591a65550 100644
--- a/fs/fuse/kio/pcs/fuse_stat.c
+++ b/fs/fuse/kio/pcs/fuse_stat.c
@@ -314,7 +314,10 @@ static int do_show_cs_stats(struct pcs_cs *cs, void *ctx)
 	int rpc_state = cs->rpc ? cs->rpc->state : PCS_RPC_UNCONN;
 	unsigned int in_flight_avg = cs->in_flight_avg;
 	struct fuse_lat_stat iolat, netlat;
-	struct pcs_perf_rate_cnt read_ops_rate, write_ops_rate, sync_ops_rate;
+	/* Supress warning about possible non-initinialized variables */
+	struct pcs_perf_rate_cnt read_ops_rate  = {},
+				 write_ops_rate = {},
+				 sync_ops_rate  = {};
 	unsigned seq;
 
 	do {
-- 
2.15.1



More information about the Devel mailing list