From patchwork Wed Dec 18 14:30:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dann frazier X-Patchwork-Id: 1212457 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 47dHVT1qSVz9sSH; Thu, 19 Dec 2019 01:30:41 +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 1ihaLV-0005GH-RU; Wed, 18 Dec 2019 14:30:37 +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 1ihaLU-0005G3-2w for kernel-team@lists.ubuntu.com; Wed, 18 Dec 2019 14:30:36 +0000 Received: from mail-il1-f197.google.com ([209.85.166.197]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ihaLT-0007LQ-Db for kernel-team@lists.ubuntu.com; Wed, 18 Dec 2019 14:30:35 +0000 Received: by mail-il1-f197.google.com with SMTP id x2so1849185ilk.18 for ; Wed, 18 Dec 2019 06:30:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EAGYo9nHm8/uVN2vYlVQdyXEBGJJHkfgSe4ItQdwrPU=; b=kheRiiJLG2qRrWNG2TLJnGxcmjDkogRj0nAiwAssLziKLHlHd7/zClNpC0SoXImyqN ErzkxepEcZZfqhbEkae5EYw5h2iE50g/g3zw6vRkGjGm4sEwZoTpxoIVCLfYEZYkaXO6 YgKjpA0JgNbYS290rjBXtp1m195hrMPCZVD3O/PUG6ECN8z2v39ejVRyUKRFHE3JVX3n zs3/n97WLfj98etYmG0+xKzOhckCIdZ44+pQl2m5iWlvhJ/BGE6W1ticrciMg6mErQHU b7YFzE2LeDm5j9fqBZ8oL5GB7XXmFL37m+/QUfN0xt/4YRLm4jJYZllcJHXvzEuwA6te +XCA== X-Gm-Message-State: APjAAAVOMpAlnu7XReMkoSUDPE+7l3Jt1LiR28uL7QEh6pb9R1gTrdTY DrGU5wBBWdbtmovrE3xiGPduDIGzuUFXBTE0JkF20A+qx86yQ+s2hpXIIYcM/nJyD4/F19zHE+7 GBHQp2+Qif69Jcnnmppl8SqBxPdxGdQ4dQ7TL2kaw1Q== X-Received: by 2002:a5d:9eda:: with SMTP id a26mr1888915ioe.238.1576679434177; Wed, 18 Dec 2019 06:30:34 -0800 (PST) X-Google-Smtp-Source: APXvYqx5jcC0NtsgeHMimbHAhhry/+wCabc+UTOld+6obI0fKF7Bv8DsUOM+9n4YqTjORv7sKbMHOQ== X-Received: by 2002:a5d:9eda:: with SMTP id a26mr1888883ioe.238.1576679433834; Wed, 18 Dec 2019 06:30:33 -0800 (PST) Received: from xps13.canonical.com (c-71-56-235-36.hsd1.co.comcast.net. [71.56.235.36]) by smtp.gmail.com with ESMTPSA id j26sm504790iok.3.2019.12.18.06.30.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2019 06:30:33 -0800 (PST) From: dann frazier To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/5][SRU Disco] md/raid0: avoid RAID0 data corruption due to layout confusion. Date: Wed, 18 Dec 2019 07:30:27 -0700 Message-Id: <20191218143031.207870-1-dann.frazier@canonical.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191218142041.206383-1-dann.frazier@canonical.com> References: <20191218142041.206383-1-dann.frazier@canonical.com> MIME-Version: 1.0 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: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: NeilBrown BugLink: https://bugs.launchpad.net/bugs/1850540 [ Upstream commit c84a1372df929033cb1a0441fb57bd3932f39ac9 ] If the drives in a RAID0 are not all the same size, the array is divided into zones. The first zone covers all drives, to the size of the smallest. The second zone covers all drives larger than the smallest, up to the size of the second smallest - etc. A change in Linux 3.14 unintentionally changed the layout for the second and subsequent zones. All the correct data is still stored, but each chunk may be assigned to a different device than in pre-3.14 kernels. This can lead to data corruption. It is not possible to determine what layout to use - it depends which kernel the data was written by. So we add a module parameter to allow the old (0) or new (1) layout to be specified, and refused to assemble an affected array if that parameter is not set. Fixes: 20d0189b1012 ("block: Introduce new bio_split()") cc: stable@vger.kernel.org (3.14+) Acked-by: Guoqing Jiang Signed-off-by: NeilBrown Signed-off-by: Song Liu Signed-off-by: Sasha Levin Signed-off-by: dann frazier --- drivers/md/raid0.c | 33 ++++++++++++++++++++++++++++++++- drivers/md/raid0.h | 14 ++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index 7c4d15207886f..ddecd07809261 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -26,6 +26,9 @@ #include "raid0.h" #include "raid5.h" +static int default_layout = 0; +module_param(default_layout, int, 0644); + #define UNSUPPORTED_MDDEV_FLAGS \ ((1L << MD_HAS_JOURNAL) | \ (1L << MD_JOURNAL_CLEAN) | \ @@ -146,6 +149,19 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf) } pr_debug("md/raid0:%s: FINAL %d zones\n", mdname(mddev), conf->nr_strip_zones); + + if (conf->nr_strip_zones == 1) { + conf->layout = RAID0_ORIG_LAYOUT; + } else if (default_layout == RAID0_ORIG_LAYOUT || + default_layout == RAID0_ALT_MULTIZONE_LAYOUT) { + conf->layout = default_layout; + } else { + pr_err("md/raid0:%s: cannot assemble multi-zone RAID0 with default_layout setting\n", + mdname(mddev)); + pr_err("md/raid0: please set raid.default_layout to 1 or 2\n"); + err = -ENOTSUPP; + goto abort; + } /* * now since we have the hard sector sizes, we can make sure * chunk size is a multiple of that sector size @@ -555,10 +571,12 @@ static void raid0_handle_discard(struct mddev *mddev, struct bio *bio) static bool raid0_make_request(struct mddev *mddev, struct bio *bio) { + struct r0conf *conf = mddev->private; struct strip_zone *zone; struct md_rdev *tmp_dev; sector_t bio_sector; sector_t sector; + sector_t orig_sector; unsigned chunk_sects; unsigned sectors; @@ -592,9 +610,22 @@ static bool raid0_make_request(struct mddev *mddev, struct bio *bio) bio = split; } + orig_sector = sector; zone = find_zone(mddev->private, §or); - tmp_dev = map_sector(mddev, zone, sector, §or); + switch (conf->layout) { + case RAID0_ORIG_LAYOUT: + tmp_dev = map_sector(mddev, zone, orig_sector, §or); + break; + case RAID0_ALT_MULTIZONE_LAYOUT: + tmp_dev = map_sector(mddev, zone, sector, §or); + break; + default: + WARN("md/raid0:%s: Invalid layout\n", mdname(mddev)); + bio_io_error(bio); + return true; + } + if (unlikely(is_mddev_broken(tmp_dev, "raid0"))) { bio_io_error(bio); return true; diff --git a/drivers/md/raid0.h b/drivers/md/raid0.h index 540e65d92642d..3816e5477db1e 100644 --- a/drivers/md/raid0.h +++ b/drivers/md/raid0.h @@ -8,11 +8,25 @@ struct strip_zone { int nb_dev; /* # of devices attached to the zone */ }; +/* Linux 3.14 (20d0189b101) made an unintended change to + * the RAID0 layout for multi-zone arrays (where devices aren't all + * the same size. + * RAID0_ORIG_LAYOUT restores the original layout + * RAID0_ALT_MULTIZONE_LAYOUT uses the altered layout + * The layouts are identical when there is only one zone (all + * devices the same size). + */ + +enum r0layout { + RAID0_ORIG_LAYOUT = 1, + RAID0_ALT_MULTIZONE_LAYOUT = 2, +}; struct r0conf { struct strip_zone *strip_zone; struct md_rdev **devlist; /* lists of rdevs, pointed to * by strip_zone->dev */ int nr_strip_zones; + enum r0layout layout; }; #endif From patchwork Wed Dec 18 14:30:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dann frazier X-Patchwork-Id: 1212458 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 47dHVV5f1hz9sPn; Thu, 19 Dec 2019 01:30: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 1ihaLX-0005Gs-1T; Wed, 18 Dec 2019 14:30:39 +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 1ihaLV-0005GA-GJ for kernel-team@lists.ubuntu.com; Wed, 18 Dec 2019 14:30:37 +0000 Received: from mail-io1-f72.google.com ([209.85.166.72]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ihaLV-0007LX-5T for kernel-team@lists.ubuntu.com; Wed, 18 Dec 2019 14:30:37 +0000 Received: by mail-io1-f72.google.com with SMTP id t70so1477498iof.4 for ; Wed, 18 Dec 2019 06:30:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8pjcQ4IOVqYa9a6wuvd/Rg9wwt55glRjMX3wFtpEw3E=; b=BhdX+KZgCEghbyyrRcp10yVOBaOMnlV6paOlQy67FR8JodLvHYy5SnZNekR7LFNMGJ TiOq6qz0bWeat9bFiW6WpbM/3VnxXg4ymdLbAIZT5CWYOCK/NYdBlQ8kMHxVIVmVWxXq eNGVox4nStV8egYDSy3Zy2EEDVBDFg27YnjMe0CYxmx4KW2zAI0YR8pQCZ128Lqsr3YD JnxKz0IKpkDRW6DDmZDP/tzS7dmFc08az3hgCBxkKrNM5kU+ts+0sldd10CTQEp32wUu /8GVbErLTQXsE1X7pUzraYvM4OuVj4Uyvg8T9g0hN8j4mV4nLbQEcLTI9TG2bFNivNWB M0sA== X-Gm-Message-State: APjAAAX3Qw7djXKSmExPdJBe/x0XUXtvDnLHziaIRWXcriPmAzn1xCNU I1Q9s47fUkORRa1n4mHsnVrZmd5Hwtb19emnJrQr9/YTUKSFOFL8Jg+xVgbX8POzW+o5XZ81WFl f+UrcwayalPRZknaqvzmYVt5OKLqe3PeQVIPxKalrZQ== X-Received: by 2002:a5e:9813:: with SMTP id s19mr1721236ioj.92.1576679435982; Wed, 18 Dec 2019 06:30:35 -0800 (PST) X-Google-Smtp-Source: APXvYqzfIfJp5nAeHMhyNVoOcDfngiy5LlUiB1bGb3SMDOM0LADdhIex8pjw0Kp7/R876mNh17A76w== X-Received: by 2002:a5e:9813:: with SMTP id s19mr1721214ioj.92.1576679435646; Wed, 18 Dec 2019 06:30:35 -0800 (PST) Received: from xps13.canonical.com (c-71-56-235-36.hsd1.co.comcast.net. [71.56.235.36]) by smtp.gmail.com with ESMTPSA id j69sm717067ilg.67.2019.12.18.06.30.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2019 06:30:35 -0800 (PST) From: dann frazier To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/5][SRU Disco] md: add feature flag MD_FEATURE_RAID0_LAYOUT Date: Wed, 18 Dec 2019 07:30:28 -0700 Message-Id: <20191218143031.207870-2-dann.frazier@canonical.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191218143031.207870-1-dann.frazier@canonical.com> References: <20191218142041.206383-1-dann.frazier@canonical.com> <20191218143031.207870-1-dann.frazier@canonical.com> MIME-Version: 1.0 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: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: NeilBrown BugLink: https://bugs.launchpad.net/bugs/1850540 Due to a bug introduced in Linux 3.14 we cannot determine the correctly layout for a multi-zone RAID0 array - there are two possibilities. It is possible to tell the kernel which to chose using a module parameter, but this can be clumsy to use. It would be best if the choice were recorded in the metadata. So add a feature flag for this purpose. If it is set, then the 'layout' field of the superblock is used to determine which layout to use. If this flag is not set, then mddev->layout gets set to -1, which causes the module parameter to be required. Acked-by: Guoqing Jiang Signed-off-by: NeilBrown Signed-off-by: Song Liu (cherry picked from commit 33f2c35a54dfd75ad0e7e86918dcbe4de799a56c) Signed-off-by: dann frazier --- drivers/md/md.c | 13 +++++++++++++ drivers/md/raid0.c | 3 +++ include/uapi/linux/raid/md_p.h | 2 ++ 3 files changed, 18 insertions(+) diff --git a/drivers/md/md.c b/drivers/md/md.c index bdd7c4c2647a4..3b1eda7444e73 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -1174,6 +1174,8 @@ static int super_90_validate(struct mddev *mddev, struct md_rdev *rdev) mddev->new_layout = mddev->layout; mddev->new_chunk_sectors = mddev->chunk_sectors; } + if (mddev->level == 0) + mddev->layout = -1; if (sb->state & (1<recovery_cp = MaxSector; @@ -1590,6 +1592,10 @@ static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_ rdev->ppl.sector = rdev->sb_start + rdev->ppl.offset; } + if ((le32_to_cpu(sb->feature_map) & MD_FEATURE_RAID0_LAYOUT) && + sb->level != 0) + return -EINVAL; + if (!refdev) { ret = 1; } else { @@ -1700,6 +1706,10 @@ static int super_1_validate(struct mddev *mddev, struct md_rdev *rdev) mddev->new_chunk_sectors = mddev->chunk_sectors; } + if (mddev->level == 0 && + !(le32_to_cpu(sb->feature_map) & MD_FEATURE_RAID0_LAYOUT)) + mddev->layout = -1; + if (le32_to_cpu(sb->feature_map) & MD_FEATURE_JOURNAL) set_bit(MD_HAS_JOURNAL, &mddev->flags); @@ -6783,6 +6793,9 @@ static int set_array_info(struct mddev *mddev, mdu_array_info_t *info) mddev->external = 0; mddev->layout = info->layout; + if (mddev->level == 0) + /* Cannot trust RAID0 layout info here */ + mddev->layout = -1; mddev->chunk_sectors = info->chunk_size >> 9; if (mddev->persistent) { diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index ddecd07809261..f5faaab603949 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -152,6 +152,9 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf) if (conf->nr_strip_zones == 1) { conf->layout = RAID0_ORIG_LAYOUT; + } else if (mddev->layout == RAID0_ORIG_LAYOUT || + mddev->layout == RAID0_ALT_MULTIZONE_LAYOUT) { + conf->layout = mddev->layout; } else if (default_layout == RAID0_ORIG_LAYOUT || default_layout == RAID0_ALT_MULTIZONE_LAYOUT) { conf->layout = default_layout; diff --git a/include/uapi/linux/raid/md_p.h b/include/uapi/linux/raid/md_p.h index b0d15c73f6d75..1f2d8c81f0e0c 100644 --- a/include/uapi/linux/raid/md_p.h +++ b/include/uapi/linux/raid/md_p.h @@ -329,6 +329,7 @@ struct mdp_superblock_1 { #define MD_FEATURE_JOURNAL 512 /* support write cache */ #define MD_FEATURE_PPL 1024 /* support PPL */ #define MD_FEATURE_MULTIPLE_PPLS 2048 /* support for multiple PPLs */ +#define MD_FEATURE_RAID0_LAYOUT 4096 /* layout is meaningful for RAID0 */ #define MD_FEATURE_ALL (MD_FEATURE_BITMAP_OFFSET \ |MD_FEATURE_RECOVERY_OFFSET \ |MD_FEATURE_RESHAPE_ACTIVE \ @@ -341,6 +342,7 @@ struct mdp_superblock_1 { |MD_FEATURE_JOURNAL \ |MD_FEATURE_PPL \ |MD_FEATURE_MULTIPLE_PPLS \ + |MD_FEATURE_RAID0_LAYOUT \ ) struct r5l_payload_header { From patchwork Wed Dec 18 14:30:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dann frazier X-Patchwork-Id: 1212460 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 47dHVY6RPRz9sRs; Thu, 19 Dec 2019 01:30:45 +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 1ihaLZ-0005ID-Gd; Wed, 18 Dec 2019 14:30:41 +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 1ihaLW-0005Gk-NR for kernel-team@lists.ubuntu.com; Wed, 18 Dec 2019 14:30:38 +0000 Received: from mail-il1-f199.google.com ([209.85.166.199]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ihaLW-0007Lc-Be for kernel-team@lists.ubuntu.com; Wed, 18 Dec 2019 14:30:38 +0000 Received: by mail-il1-f199.google.com with SMTP id w6so1859489ill.12 for ; Wed, 18 Dec 2019 06:30:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2vEZGdcu9GDRj6cGX3BBpVHcTUvwUGDXsYvU60T+Ko8=; b=ZpIaNlVn/Kp+f8YabA6DfpexH3OQhDGNs0dent3SsrZ15mcNBNIQIbbElJblwemB79 BK8zwuEP7P+T785gYEmpTULvFNNiZVnzTvsf3ICZgrlZqdgpUfaycqDVp7ucdXaye034 pR74PiHc3Mm0iWNLs/pRiE3ZCcGX7SCg5TGzSse8IMeFTiO1Zp7bjDawncbYgVOvbzd4 GWvQFS4oyqZk+la+A3olcr9jQSFS2D+3InrZwMhsiTilDkD1QfzUS9U7R+06udr6l0DT OwRHPoLIOV8eGmNk7q1MyBafSkcwkNWmziPNtY/bvvgJz0tdsV/gZkddILQs5HEL3qjO awRg== X-Gm-Message-State: APjAAAWYslW4/V1sbehHCHNsBS5EIZ7tsjcqA/osylF84IcQeRBEDjM7 DujjVR1xcpEs7lGeXnNA1w0O1NP8PYoDIjJEUXwxaFOfEOy4d33kUgdl/36oHut3y4G2lCHURhu gvwJPZ+0S6fCmK2TlPtDCelNb2RacZE8bsiUQxFdqag== X-Received: by 2002:a6b:bd06:: with SMTP id n6mr1873186iof.165.1576679437225; Wed, 18 Dec 2019 06:30:37 -0800 (PST) X-Google-Smtp-Source: APXvYqy+DUPf5YBa/7JCsNEjNtGsLQ9wbd5s6TwMHc3qWLY/9CHk3LnHx3KiXiu9RYSljfd9aySm7w== X-Received: by 2002:a6b:bd06:: with SMTP id n6mr1873164iof.165.1576679436951; Wed, 18 Dec 2019 06:30:36 -0800 (PST) Received: from xps13.canonical.com (c-71-56-235-36.hsd1.co.comcast.net. [71.56.235.36]) by smtp.gmail.com with ESMTPSA id e5sm714171ilq.77.2019.12.18.06.30.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2019 06:30:36 -0800 (PST) From: dann frazier To: kernel-team@lists.ubuntu.com Subject: [PATCH 3/5][SRU Disco] md/raid0: fix warning message for parameter default_layout Date: Wed, 18 Dec 2019 07:30:29 -0700 Message-Id: <20191218143031.207870-3-dann.frazier@canonical.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191218143031.207870-1-dann.frazier@canonical.com> References: <20191218142041.206383-1-dann.frazier@canonical.com> <20191218143031.207870-1-dann.frazier@canonical.com> MIME-Version: 1.0 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: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Song Liu BugLink: https://bugs.launchpad.net/bugs/1850540 [ Upstream commit 3874d73e06c9b9dc15de0b7382fc223986d75571 ] The message should match the parameter, i.e. raid0.default_layout. Fixes: c84a1372df92 ("md/raid0: avoid RAID0 data corruption due to layout confusion.") Cc: NeilBrown Reported-by: Ivan Topolsky Signed-off-by: Song Liu Signed-off-by: Sasha Levin Signed-off-by: dann frazier --- 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 f5faaab603949..da757df6dded4 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -161,7 +161,7 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf) } else { pr_err("md/raid0:%s: cannot assemble multi-zone RAID0 with default_layout setting\n", mdname(mddev)); - pr_err("md/raid0: please set raid.default_layout to 1 or 2\n"); + pr_err("md/raid0: please set raid0.default_layout to 1 or 2\n"); err = -ENOTSUPP; goto abort; } From patchwork Wed Dec 18 14:30:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dann frazier X-Patchwork-Id: 1212459 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 47dHVX3g5Dz9sSH; Thu, 19 Dec 2019 01:30:44 +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 1ihaLZ-0005Hw-7R; Wed, 18 Dec 2019 14:30:41 +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 1ihaLX-0005HR-TV for kernel-team@lists.ubuntu.com; Wed, 18 Dec 2019 14:30:39 +0000 Received: from mail-il1-f198.google.com ([209.85.166.198]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ihaLX-0007Lj-H5 for kernel-team@lists.ubuntu.com; Wed, 18 Dec 2019 14:30:39 +0000 Received: by mail-il1-f198.google.com with SMTP id j17so1873215ilc.10 for ; Wed, 18 Dec 2019 06:30:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QTgHtrJ47aPRRs+xplh0yHPUHKLStwEaGstisgrDFco=; b=P5QPl46zWUK8MUxFtycWJ1h21WVaTC1X7nj+JBXQOZP2WAMkhqEFM73Kq6F86D+/T6 4r3UfIdUPdrqsrC39aoIwFfOQP+uUfNOXkyggOEUfxY4QWby+MEzh21JoShng30+Qksc 8n84o4wInmCJ3ZUnNeP/ASLgOyvB1oqew+++qi//GY1rR84HTnXkkcNtgByub+8uGlsN C0vZnYbfQ2If3Mf5lD3Y4vbHplnGJvDNY2XpPJqJCSQdf7NyabsznzrAlnHE7Gpidqzd I7KaR5RbwJdM5EzSCTd57nfDIs1L7hh9epBF3lfFLV1XYLRfX+RfZgGvqOcgK2/fg8IX aQ2w== X-Gm-Message-State: APjAAAV+MsyahOOHBWn7t5fMcWNFsmTEikovVN3du6CuAW84lrveZP2A n030GVD7EenHLXq0L4jOo3NEnGoWNl3DfwstckbVmHiY7rG0EBhtAO65HHaVqCeHE4jJUwMFp+l jX3KVmlDebHF7trMVsrZDCMUQW9mtyAIgnOFxzzg/+w== X-Received: by 2002:a92:4781:: with SMTP id e1mr2066969ilk.147.1576679438426; Wed, 18 Dec 2019 06:30:38 -0800 (PST) X-Google-Smtp-Source: APXvYqwkMu9PRuxCuWC1UcHcaOJMlfUQjWRokFJQEoPfMhCP116SPEuF/KiG9+I3WxtIq8s5KAqQhg== X-Received: by 2002:a92:4781:: with SMTP id e1mr2066951ilk.147.1576679438211; Wed, 18 Dec 2019 06:30:38 -0800 (PST) Received: from xps13.canonical.com (c-71-56-235-36.hsd1.co.comcast.net. [71.56.235.36]) by smtp.gmail.com with ESMTPSA id w5sm51405iob.26.2019.12.18.06.30.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2019 06:30:37 -0800 (PST) From: dann frazier To: kernel-team@lists.ubuntu.com Subject: [PATCH 4/5][SRU Disco] md/raid0: Fix an error message in raid0_make_request() Date: Wed, 18 Dec 2019 07:30:30 -0700 Message-Id: <20191218143031.207870-4-dann.frazier@canonical.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191218143031.207870-1-dann.frazier@canonical.com> References: <20191218142041.206383-1-dann.frazier@canonical.com> <20191218143031.207870-1-dann.frazier@canonical.com> MIME-Version: 1.0 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: , 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 --- 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 da757df6dded4..534a51e7d7b02 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -624,7 +624,7 @@ static bool 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; } From patchwork Wed Dec 18 14:30:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dann frazier X-Patchwork-Id: 1212461 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 47dHVb5rK5z9sSS; Thu, 19 Dec 2019 01:30:47 +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 1ihaLb-0005Kw-W3; Wed, 18 Dec 2019 14:30:44 +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 1ihaLZ-0005Hv-6t for kernel-team@lists.ubuntu.com; Wed, 18 Dec 2019 14:30:41 +0000 Received: from mail-il1-f200.google.com ([209.85.166.200]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ihaLY-0007M1-QX for kernel-team@lists.ubuntu.com; Wed, 18 Dec 2019 14:30:40 +0000 Received: by mail-il1-f200.google.com with SMTP id z12so1855689ilh.17 for ; Wed, 18 Dec 2019 06:30:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nk7dUGnZdCGUOJ3nrYjRr+jErFdAa3+BUffdO/jHacM=; b=S/0onn4fztTd/ocpX2k2BRq4rJgiL6eTvsl1PT0aoamdG2awP0U7v9hMevmIlywMiU QfuuOPgL/rbffLyc9utL5Noy92wfnV/lDt6ZhKTubiaVgB5TJ4FACwLtIkf8I7jqHnjy KO9hnkR8032P/tRzOpcypzk/4e++NU721/lhXoKU7UG+17zWANAmyZ+LMXZ4WDpW3am5 LAozGfSFu4kLjA9cmlhWzfIthMhnqOxT7W8/q1d/OS5QneVv71/1I5MPSmW35epSF61I sR36D2LejetSYfVVJJTsgv77rOxntj4mkkiDoD9TK2fEPeSjh1e/fGoWdSCcIK8Q2b86 wTAA== X-Gm-Message-State: APjAAAUZysvSoxMl6kDEdwvPeaPlrhsmHukCB3DeipCT6ydolBWhCmXo uUurHjsZ2ADhKwmn8OCa1HutwQXFG650ICW600uxjyoEQYZh2HtX6WLR4sERQ3ay8fpNfse0lD8 KJZWdZfv1/9rwy24Aa+jKjceTERkQHvdNkyP7XRpVlg== X-Received: by 2002:a05:6602:1233:: with SMTP id z19mr1820498iot.89.1576679439608; Wed, 18 Dec 2019 06:30:39 -0800 (PST) X-Google-Smtp-Source: APXvYqz9xzK774ddKMqKpdf3mgRoo4Umjoo5CqvUttBCPUJBYs5W48HySLMSNLLNpqkqnQPSOS+v4w== X-Received: by 2002:a05:6602:1233:: with SMTP id z19mr1820473iot.89.1576679439340; Wed, 18 Dec 2019 06:30:39 -0800 (PST) Received: from xps13.canonical.com (c-71-56-235-36.hsd1.co.comcast.net. [71.56.235.36]) by smtp.gmail.com with ESMTPSA id c69sm719383ilf.41.2019.12.18.06.30.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2019 06:30:38 -0800 (PST) From: dann frazier To: kernel-team@lists.ubuntu.com Subject: [PATCH 5/5][SRU Disco] UBUNTU: SAUCE: md/raid0: Link to wiki with guidance on multi-zone RAID0 layout migration Date: Wed, 18 Dec 2019 07:30:31 -0700 Message-Id: <20191218143031.207870-5-dann.frazier@canonical.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191218143031.207870-1-dann.frazier@canonical.com> References: <20191218142041.206383-1-dann.frazier@canonical.com> <20191218143031.207870-1-dann.frazier@canonical.com> MIME-Version: 1.0 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: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1850540 Helping an administrator understand this issue and how to deal with it requires more text than achievable in a kernel error message. Let's clarify the issue in the Ubuntu wiki, and have the kernel emit a link to it. I've submitted a similar change upstream: https://marc.info/?l=linux-raid&m=157360088014027&w=2 Should it get merged, we should consider replacing this patch with that one. Otherwise, it is probably safe to drop this SAUCE patch after focal. Signed-off-by: dann frazier --- drivers/md/raid0.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index 534a51e7d7b02..8840715dced44 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -162,6 +162,8 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf) pr_err("md/raid0:%s: cannot assemble multi-zone RAID0 with default_layout setting\n", mdname(mddev)); pr_err("md/raid0: please set raid0.default_layout to 1 or 2\n"); + pr_err("md/raid0: Read the following page for more information:\n"); + pr_err("md/raid0: https://wiki.ubuntu.com/Kernel/Raid0LayoutMigration\n"); err = -ENOTSUPP; goto abort; }