kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] md/raid1: Fix a warning message in remove_wb()
@ 2019-06-26  9:42 Dan Carpenter
  2019-06-26 19:20 ` Song Liu
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2019-06-26  9:42 UTC (permalink / raw)
  To: kernel-janitors

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")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
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(-)

diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 3d44da663797..34e26834ad28 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -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);
 }
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] md/raid1: Fix a warning message in remove_wb()
  2019-06-26  9:42 [PATCH] md/raid1: Fix a warning message in remove_wb() Dan Carpenter
@ 2019-06-26 19:20 ` Song Liu
  0 siblings, 0 replies; 2+ messages in thread
From: Song Liu @ 2019-06-26 19:20 UTC (permalink / raw)
  To: kernel-janitors

On Wed, Jun 26, 2019 at 2:44 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> 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")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied. Thanks for the fix.

Song

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-26 19:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-26  9:42 [PATCH] md/raid1: Fix a warning message in remove_wb() Dan Carpenter
2019-06-26 19:20 ` Song Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).