diff mbox series

[X,4/6] md/raid0: Fix an error message in raid0_make_request()

Message ID 20200115091428.32502-5-stefan.bader@canonical.com
State New
Headers show
Series None | expand

Commit Message

Stefan Bader Jan. 15, 2020, 9:14 a.m. UTC
From: Dan Carpenter <dan.carpenter@oracle.com>

BugLink: https://bugs.launchpad.net/bugs/1850540

[ Upstream commit e3fc3f3d0943b126f76b8533960e4168412d9e5a ]

The first argument to WARN() is supposed to be a condition.  The
original code will just print the mdname() instead of the full warning
message.

Fixes: c84a1372df92 ("md/raid0: avoid RAID0 data corruption due to layout confusion.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>

Signed-off-by: dann frazier <dann.frazier@canonical.com>
(backported from bionic/18.04 submission into xenial/16.04)
[smb: minor contextual adjustments]
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
---
 drivers/md/raid0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index 2e90390d4f2a..8636d9d2ef8e 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -513,7 +513,7 @@  static void raid0_make_request(struct mddev *mddev, struct bio *bio)
 			tmp_dev = map_sector(mddev, zone, sector, &sector);
 			break;
 		default:
-			WARN("md/raid0:%s: Invalid layout\n", mdname(mddev));
+			WARN(1, "md/raid0:%s: Invalid layout\n", mdname(mddev));
 			bio_io_error(bio);
 			return true;
 		}