From patchwork Wed Jan 15 09:14:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Bader X-Patchwork-Id: 1223262 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47yM9057Xmz9sRX; Wed, 15 Jan 2020 20:14:42 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1irel4-0007dR-Gs; Wed, 15 Jan 2020 09:14:38 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1irekw-0007cK-UP for kernel-team@lists.ubuntu.com; Wed, 15 Jan 2020 09:14:30 +0000 Received: from 1.general.smb.uk.vpn ([10.172.193.28] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1irekw-00063Y-Ln for kernel-team@lists.ubuntu.com; Wed, 15 Jan 2020 09:14:30 +0000 From: Stefan Bader To: kernel-team@lists.ubuntu.com Subject: [PATCH X 4/6] md/raid0: Fix an error message in raid0_make_request() Date: Wed, 15 Jan 2020 10:14:26 +0100 Message-Id: <20200115091428.32502-5-stefan.bader@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200115091428.32502-1-stefan.bader@canonical.com> References: <20191218142041.206383-1-dann.frazier@canonical.com> <20200115091428.32502-1-stefan.bader@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Dan Carpenter 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 Signed-off-by: Song Liu Signed-off-by: Sasha Levin Signed-off-by: dann frazier (backported from bionic/18.04 submission into xenial/16.04) [smb: minor contextual adjustments] Signed-off-by: Stefan Bader --- drivers/md/raid0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, §or); 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; }