Skip to contentSkip to conversation

md/raid1: Fix a warning message in remove_wb()

PATCH Applied Dan Carpenter 2 participants 2 messages Jun 26, 2019

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

PATCH 1/1 md/raid1: Fix a warning message in remove_wb()

The WARN_ON() macro doesn't take an error message, it just takes a condition. I've changed this to use WARN(1, "...") instead.

Fixes 3e148a320979 ("md/raid1: fix potential data inconsistency issue with write behind device")

---
I also considered changing it to:

	WARN(!found, "...");

but I decided this way was more clear. It's to have the error path indented an extra tab.

---
 drivers/md/raid1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/raid1.c +1 -1
index 3d44da663797..34e26834ad28 100644
@@ -96,7 +96,7 @@ static void remove_wb(struct md_rdev *rdev, sector_t lo, sector_t hi)
 		}
 
 	if (!found)
-		WARN_ON("The write behind IO is not recorded\n");
+		WARN(1, "The write behind IO is not recorded\n");
 	spin_unlock_irqrestore(&rdev->wb_list_lock, flags);
 	wake_up(&rdev->wb_io_wait);
 }
Signature · 1 line
2.20.1
Applied
#1 lore raw
Quoted 6 lines · Dan Carpenter

The WARN_ON() macro doesn't take an error message, it just takes a condition. I've changed this to use WARN(1, "...") instead.

Fixes 3e148a320979 ("md/raid1: fix potential data inconsistency issue with write behind device")

Applied. Thanks for the fix.

Song