Skip to contentSkip to conversation

raid5-ppl: silence a misleading warning message

PATCH Applied Dan Carpenter 3 participants 3 messages Mar 21, 2017 – Mar 24, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 raid5-ppl: silence a misleading warning message

The "need_cache_flush" variable is never set to false. When the variable is true that means we print a warning message at the end of the function.

Fixes 3418d036c81d ("raid5-ppl: Partial Parity Log write logging implementation")
drivers/md/raid5-ppl.c +1 -1
index 27bad3e2d7ce..86ea9addb51a 100644
@@ -1070,7 +1070,7 @@ int ppl_init_log(struct r5conf *conf)
 	struct mddev *mddev = conf->mddev;
 	int ret = 0;
 	int i;
-	bool need_cache_flush;
+	bool need_cache_flush = false;
 
 	pr_debug("md/raid:%s: enabling distributed Partial Parity Log\n",
 		 mdname(conf->mddev));
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Dan Carpenter

The "need_cache_flush" variable is never set to false. When the variable is true that means we print a warning message at the end of the function.

Fixes 3418d036c81d ("raid5-ppl: Partial Parity Log write logging implementation")

Good catch, thanks. I thought gcc would warn about such issues, I'll have to be more careful.

Applied
#2 lore raw
In reply to Dan Carpenter
Quoted 6 lines · Dan Carpenter

The "need_cache_flush" variable is never set to false. When the variable is true that means we print a warning message at the end of the function.

Fixes 3418d036c81d ("raid5-ppl: Partial Parity Log write logging implementation")

applied, thanks!

Quoted 13 lines
drivers/md/raid5-ppl.c +1 -1
index 27bad3e2d7ce..86ea9addb51a 100644
@@ -1070,7 +1070,7 @@ int ppl_init_log(struct r5conf *conf)
 	struct mddev *mddev = conf->mddev;
 	int ret = 0;
 	int i;
-	bool need_cache_flush;
+	bool need_cache_flush = false;
 
 	pr_debug("md/raid:%s: enabling distributed Partial Parity Log\n",
 		 mdname(conf->mddev));