From patchwork Wed Jan 15 09:14:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Bader X-Patchwork-Id: 1223263 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 47yM905BrQz9sS3; 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 1irel0-0007ce-CU; Wed, 15 Jan 2020 09:14:34 +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 1irekv-0007c1-Dy for kernel-team@lists.ubuntu.com; Wed, 15 Jan 2020 09:14:29 +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 1irekv-00063G-4j for kernel-team@lists.ubuntu.com; Wed, 15 Jan 2020 09:14:29 +0000 From: Stefan Bader To: kernel-team@lists.ubuntu.com Subject: [PATCH X 1/6] md/raid0: avoid RAID0 data corruption due to layout confusion. Date: Wed, 15 Jan 2020 10:14:23 +0100 Message-Id: <20200115091428.32502-2-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: 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 (backported from bionic/18.04 submission into xenial/16.04) [smb: minor contextual changes] Signed-off-by: Stefan Bader --- drivers/md/raid0.c | 32 +++++++++++++++++++++++++++++++- drivers/md/raid0.h | 14 ++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index 7a67e7dcf546..7aa64c55f68d 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -25,6 +25,9 @@ #include "raid0.h" #include "raid5.h" +static int default_layout = 0; +module_param(default_layout, int, 0644); + static int raid0_congested(struct mddev *mddev, int bits) { struct r0conf *conf = mddev->private; @@ -137,6 +140,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 @@ -454,6 +470,7 @@ static inline int is_io_in_chunk_boundary(struct mddev *mddev, static void raid0_make_request(struct mddev *mddev, struct bio *bio) { + struct r0conf *conf = mddev->private; struct strip_zone *zone; struct md_rdev *tmp_dev; struct bio *split; @@ -465,6 +482,7 @@ static void raid0_make_request(struct mddev *mddev, struct bio *bio) do { sector_t sector = bio->bi_iter.bi_sector; + sector_t orig_sector; unsigned chunk_sects = mddev->chunk_sectors; unsigned sectors = chunk_sects - @@ -482,8 +500,20 @@ static void raid0_make_request(struct mddev *mddev, struct bio *bio) split = bio; } + 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; + } split->bi_bdev = tmp_dev->bdev; split->bi_iter.bi_sector = sector + zone->dev_start + tmp_dev->data_offset; diff --git a/drivers/md/raid0.h b/drivers/md/raid0.h index 7127a623f5da..ad60bfa58bd5 100644 --- a/drivers/md/raid0.h +++ b/drivers/md/raid0.h @@ -7,11 +7,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 Jan 15 09:14:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Bader X-Patchwork-Id: 1223264 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 47yM911dqLz9sSG; Wed, 15 Jan 2020 20:14:43 +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 1irel5-0007eG-Vk; Wed, 15 Jan 2020 09:14: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 1irekv-0007c7-V6 for kernel-team@lists.ubuntu.com; Wed, 15 Jan 2020 09:14:29 +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 1irekv-00063K-L6 for kernel-team@lists.ubuntu.com; Wed, 15 Jan 2020 09:14:29 +0000 From: Stefan Bader To: kernel-team@lists.ubuntu.com Subject: [PATCH X 2/6] md: add feature flag MD_FEATURE_RAID0_LAYOUT Date: Wed, 15 Jan 2020 10:14:24 +0100 Message-Id: <20200115091428.32502-3-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: 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 (backported from bionic/18.04 submisstion into xenial/16.04) [smb: contextual adjustments] Signed-off-by: Stefan Bader --- 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 c7a006e102de..d7eae9bc76bc 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -1091,6 +1091,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; @@ -1498,6 +1500,10 @@ static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_ } else if (sb->bblog_offset != 0) rdev->badblocks.shift = 0; + if ((le32_to_cpu(sb->feature_map) & MD_FEATURE_RAID0_LAYOUT) && + sb->level != 0) + return -EINVAL; + if (!refdev) { ret = 1; } else { @@ -1609,6 +1615,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; + } else if (mddev->pers == NULL) { /* Insist of good event counter while assembling, except for * spares (which don't need an event count) */ @@ -6402,6 +6412,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; mddev->max_disks = MD_SB_DISKS; diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index 7aa64c55f68d..0501114e5321 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -143,6 +143,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 c3e654c6d518..ff8f66aa9923 100644 --- a/include/uapi/linux/raid/md_p.h +++ b/include/uapi/linux/raid/md_p.h @@ -313,6 +313,7 @@ struct mdp_superblock_1 { */ #define MD_FEATURE_CLUSTERED 256 /* clustered MD */ #define MD_FEATURE_JOURNAL 512 /* support write cache */ +#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 \ @@ -323,6 +324,7 @@ struct mdp_superblock_1 { |MD_FEATURE_RECOVERY_BITMAP \ |MD_FEATURE_CLUSTERED \ |MD_FEATURE_JOURNAL \ + |MD_FEATURE_RAID0_LAYOUT \ ) struct r5l_payload_header { From patchwork Wed Jan 15 09:14:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Bader X-Patchwork-Id: 1223265 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 47yM936xtHz9sRQ; Wed, 15 Jan 2020 20:14: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 1irelA-0007g3-7E; Wed, 15 Jan 2020 09:14: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 1irekw-0007cD-FJ 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-00063Q-5a 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 3/6] md/raid0: fix warning message for parameter default_layout Date: Wed, 15 Jan 2020 10:14:25 +0100 Message-Id: <20200115091428.32502-4-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: 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 (cherry picked from bionic/18.04 submission into xenial/16.04) 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 0501114e5321..2e90390d4f2a 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -152,7 +152,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 Jan 15 09:14:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Bader X-Patchwork-Id: 1223266 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 47yM983X8Rz9sRX; Wed, 15 Jan 2020 20:14:52 +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 1irelE-0007iT-F8; Wed, 15 Jan 2020 09:14:48 +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 1irekx-0007cQ-F7 for kernel-team@lists.ubuntu.com; Wed, 15 Jan 2020 09:14:31 +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 1irekx-00063f-5M for kernel-team@lists.ubuntu.com; Wed, 15 Jan 2020 09:14:31 +0000 From: Stefan Bader To: kernel-team@lists.ubuntu.com Subject: [PATCH X 5/6] UBUNTU: SAUCE: md/raid0: Link to wiki with guidance on multi-zone RAID0 layout migration Date: Wed, 15 Jan 2020 10:14:27 +0100 Message-Id: <20200115091428.32502-6-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: dann frazier 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 (cherry picked from bionic/18.04 submission into xenial/16.04) Signed-off-by: Stefan Bader --- drivers/md/raid0.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index 8636d9d2ef8e..b686b092239f 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -153,6 +153,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; } From patchwork Wed Jan 15 09:14:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Bader X-Patchwork-Id: 1223267 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 47yM99746Cz9sSG; Wed, 15 Jan 2020 20:14:53 +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 1irelG-0007kI-MS; Wed, 15 Jan 2020 09:14:50 +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 1irekx-0007cX-TU for kernel-team@lists.ubuntu.com; Wed, 15 Jan 2020 09:14:31 +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 1irekx-00063k-L5 for kernel-team@lists.ubuntu.com; Wed, 15 Jan 2020 09:14:31 +0000 From: Stefan Bader To: kernel-team@lists.ubuntu.com Subject: [PATCH X/B/D/E 6/6] UBUNTU: SAUCE: md/raid0: Use kernel specific layout Date: Wed, 15 Jan 2020 10:14:28 +0100 Message-Id: <20200115091428.32502-7-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" BugLink: https://bugs.launchpad.net/bugs/1850540 This allows to roll out the support for the alternate layout which accidentally got introduced since kernel v3.14+ without causing breakage on reboot. The real danger is moving between a 3.13 or older kernel and any newer. This either has already happened and the damage has potentially been done or is not yet immediate or not happening at all (if the raid0 array was created by a 3.14+ kernel). So it is better to just warn from the kernel or once the user-space tool supporting meta-data update gets rolled out, from there as well. Once user-space is in place an with a bit of waiting time this change should get reverted later. Signed-off-by: Stefan Bader --- drivers/md/raid0.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index b686b092239f..7dc6e0193f3c 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -150,13 +150,12 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf) 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", + conf->layout = RAID0_ALT_MULTIZONE_LAYOUT; + pr_warn("md/raid0:%s: !!! DEFAULTING TO ALTERNATE LAYOUT !!!\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; + pr_warn("md/raid0: Please set raid0.default_layout to 1 or 2\n"); + pr_warn("md/raid0: Read the following page for more information:\n"); + pr_warn("md/raid0: https://wiki.ubuntu.com/Kernel/Raid0LayoutMigration\n"); } /* * now since we have the hard sector sizes, we can make sure