Skip to contentSkip to conversation

md/raid0: Fix an error message in raid0_make_request()

PATCH Applied Dan Carpenter 2 participants 2 messages Sep 21, 2019 – Oct 1, 2019

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

PATCH 1/1 md/raid0: Fix an error message in raid0_make_request()

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.")
---
 drivers/md/raid0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/raid0.c +1 -1
index f61693e59684..3956ea502f97 100644
@@ -615,7 +615,7 @@ static bool 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;
 	}
Signature · 1 line
2.20.1
Applied
#1 lore raw
Quoted 16 lines · Dan Carpenter

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.")
---
 drivers/md/raid0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/raid0.c +0 -0
index f61693e59684..3956ea502f97 100644

drivers/md/raid0.c static bool raid0_make_request(struct mddev *mddev, struct bio *bio) · line 620

Quoted 7 lines
drivers/md/raid0.c +1 -1
@@ -615,7 +615,7 @@ static bool 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;

Applied. Thanks for the fix!

Song