From patchwork Thu Jun 9 21:11:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 12875982 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6EA95C43334 for ; Thu, 9 Jun 2022 21:11:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345261AbiFIVLq (ORCPT ); Thu, 9 Jun 2022 17:11:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237285AbiFIVLn (ORCPT ); Thu, 9 Jun 2022 17:11:43 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7652123147B for ; Thu, 9 Jun 2022 14:11:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:Cc:To:From:content-disposition; bh=HKNnb0uocQ5mz8TbQIStA9jkPVM6s1aXB3S7oRj3Xqg=; b=tPVki2v8+XSn5mfnvO4ja04O/k MAioxkrp1nGtZrxtgB6BtyKYVjZffevSUU138FkDyfbM6TiJ4fzCII0z/nmB1SMw9FFXRcf+mjLsu 0o4H1iI2Ps0Tu5Z+D0wKFn+jYvfbZy76+vozvpQK4yD8vxlSCFmeGpVi4CKE9BqHcczyWX704IvRe LzCsa8JVMlJ+nMhsRABjjczYbZVBCQI/ItemuzqHZCtpCA8xZoLihVHVoSrjsVVkFYuUiNyM+GUe1 6BEbFfW0cFXfXJG8kRRNKuRZnG/kPu5JV+OS7fAtjnyZXaR5yOHpWd8/hEpG5bHqS723r3SMJ70WD A24CH7jA==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nzPRJ-0037Xl-R3; Thu, 09 Jun 2022 15:11:38 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.94.2) (envelope-from ) id 1nzPRE-0001LR-9L; Thu, 09 Jun 2022 15:11:32 -0600 From: Logan Gunthorpe To: linux-raid@vger.kernel.org, Jes Sorensen Cc: Song Liu , Christoph Hellwig , Donald Buczek , Guoqing Jiang , Xiao Ni , Himanshu Madhani , Mariusz Tkaczyk , Coly Li , Bruce Dubbs , Stephen Bates , Martin Oliveira , David Sloan , Logan Gunthorpe Date: Thu, 9 Jun 2022 15:11:17 -0600 Message-Id: <20220609211130.5108-2-logang@deltatee.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220609211130.5108-1-logang@deltatee.com> References: <20220609211130.5108-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-raid@vger.kernel.org, jsorensen@fb.com, song@kernel.org, hch@infradead.org, buczek@molgen.mpg.de, guoqing.jiang@linux.dev, xni@redhat.com, himanshu.madhani@oracle.com, mariusz.tkaczyk@linux.intel.com, colyli@suse.de, bruce.dubbs@gmail.com, sbates@raithlin.com, Martin.Oliveira@eideticom.com, David.Sloan@eideticom.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com Subject: [PATCH mdadm v1 01/14] Makefile: Don't build static build with everything X-SA-Exim-Version: 4.2.1 (built Sat, 13 Feb 2021 17:57:42 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org Running the test require building everything, but it seems to be difficult to build the static version of mdadm now seeing there is no readily available static udev library. There's no need to build it, so just remove it. Signed-off-by: Logan Gunthorpe --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index bf126033b841..f2f671cefe66 100644 --- a/Makefile +++ b/Makefile @@ -182,7 +182,7 @@ check_rundir: echo "***** or set CHECK_RUN_DIR=0"; exit 1; \ fi -everything: all mdadm.static swap_super test_stripe raid6check \ +everything: all swap_super test_stripe raid6check \ mdadm.Os mdadm.O2 man everything-test: all mdadm.static swap_super test_stripe \ mdadm.Os mdadm.O2 man From patchwork Thu Jun 9 21:11:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 12875984 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B0D1C43334 for ; Thu, 9 Jun 2022 21:11:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345355AbiFIVLs (ORCPT ); Thu, 9 Jun 2022 17:11:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344502AbiFIVLn (ORCPT ); Thu, 9 Jun 2022 17:11:43 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76C6B26D8AD for ; Thu, 9 Jun 2022 14:11:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:Cc:To:From:content-disposition; bh=eIIYYksKwm4eMsz6SISsgJeWHeeGvIWUpSt4vbgnAEw=; b=bGrsPap/3DuZ0e8VX3zeH+jgru 62G4A2dQAvMsRCvPRI+pDGZN167+meiWVh/2W8ctzJeX2OEqQU4xuH30bzCxINJ3El2m1Mp6nn1EH eUgMqNHwFIZCkHQjeU19JJ3IfdjjfPbhf3a0UDzt6bdRNccPlnTVXQEBw1Xl28ONYTqoOk5fQCGgS Gv9w3zFk8kCUacGTFfPBKMRutDtH13K/yQ212G/MlaZqAjjZvB53yrRo+YIWZbGWjpgB4ai3uhz8k ytQSl0LfN/XI333bUAEwC4KgH5RnAoahv1V0BqHpvWRVdZ1EWQOnQo0jNPTOTw7gH7wkTDSloTwCN DgRi+q2w==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nzPRJ-0037Xm-R3; Thu, 09 Jun 2022 15:11:39 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.94.2) (envelope-from ) id 1nzPRE-0001LU-E4; Thu, 09 Jun 2022 15:11:32 -0600 From: Logan Gunthorpe To: linux-raid@vger.kernel.org, Jes Sorensen Cc: Song Liu , Christoph Hellwig , Donald Buczek , Guoqing Jiang , Xiao Ni , Himanshu Madhani , Mariusz Tkaczyk , Coly Li , Bruce Dubbs , Stephen Bates , Martin Oliveira , David Sloan , Logan Gunthorpe Date: Thu, 9 Jun 2022 15:11:18 -0600 Message-Id: <20220609211130.5108-3-logang@deltatee.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220609211130.5108-1-logang@deltatee.com> References: <20220609211130.5108-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-raid@vger.kernel.org, jsorensen@fb.com, song@kernel.org, hch@infradead.org, buczek@molgen.mpg.de, guoqing.jiang@linux.dev, xni@redhat.com, himanshu.madhani@oracle.com, mariusz.tkaczyk@linux.intel.com, colyli@suse.de, bruce.dubbs@gmail.com, sbates@raithlin.com, Martin.Oliveira@eideticom.com, David.Sloan@eideticom.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com Subject: [PATCH mdadm v1 02/14] DDF: Cleanup validate_geometry_ddf_container() X-SA-Exim-Version: 4.2.1 (built Sat, 13 Feb 2021 17:57:42 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org Move the function up so that the function declaration is not necessary and remove the unused arguments to the function. No functional changes are intended but will help with a bug fix in the next patch. Signed-off-by: Logan Gunthorpe Acked-by: Mariusz Tkaczyk --- super-ddf.c | 88 ++++++++++++++++++++++++----------------------------- 1 file changed, 39 insertions(+), 49 deletions(-) diff --git a/super-ddf.c b/super-ddf.c index 8cda23a74030..d3c7a4082046 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -503,13 +503,6 @@ struct ddf_super { static int load_super_ddf_all(struct supertype *st, int fd, void **sbp, char *devname); static int get_svd_state(const struct ddf_super *, const struct vcl *); -static int -validate_geometry_ddf_container(struct supertype *st, - int level, int layout, int raiddisks, - int chunk, unsigned long long size, - unsigned long long data_offset, - char *dev, unsigned long long *freesize, - int verbose); static int validate_geometry_ddf_bvd(struct supertype *st, int level, int layout, int raiddisks, @@ -3322,6 +3315,42 @@ static int reserve_space(struct supertype *st, int raiddisks, return 1; } +static int +validate_geometry_ddf_container(struct supertype *st, + int level, int raiddisks, + unsigned long long data_offset, + char *dev, unsigned long long *freesize, + int verbose) +{ + int fd; + unsigned long long ldsize; + + if (level != LEVEL_CONTAINER) + return 0; + if (!dev) + return 1; + + fd = dev_open(dev, O_RDONLY|O_EXCL); + if (fd < 0) { + if (verbose) + pr_err("ddf: Cannot open %s: %s\n", + dev, strerror(errno)); + return 0; + } + if (!get_dev_size(fd, dev, &ldsize)) { + close(fd); + return 0; + } + close(fd); + if (freesize) { + *freesize = avail_size_ddf(st, ldsize >> 9, INVALID_SECTORS); + if (*freesize == 0) + return 0; + } + + return 1; +} + static int validate_geometry_ddf(struct supertype *st, int level, int layout, int raiddisks, int *chunk, unsigned long long size, @@ -3347,11 +3376,9 @@ static int validate_geometry_ddf(struct supertype *st, level = LEVEL_CONTAINER; if (level == LEVEL_CONTAINER) { /* Must be a fresh device to add to a container */ - return validate_geometry_ddf_container(st, level, layout, - raiddisks, *chunk, - size, data_offset, dev, - freesize, - verbose); + return validate_geometry_ddf_container(st, level, raiddisks, + data_offset, dev, + freesize, verbose); } if (!dev) { @@ -3449,43 +3476,6 @@ static int validate_geometry_ddf(struct supertype *st, return 1; } -static int -validate_geometry_ddf_container(struct supertype *st, - int level, int layout, int raiddisks, - int chunk, unsigned long long size, - unsigned long long data_offset, - char *dev, unsigned long long *freesize, - int verbose) -{ - int fd; - unsigned long long ldsize; - - if (level != LEVEL_CONTAINER) - return 0; - if (!dev) - return 1; - - fd = dev_open(dev, O_RDONLY|O_EXCL); - if (fd < 0) { - if (verbose) - pr_err("ddf: Cannot open %s: %s\n", - dev, strerror(errno)); - return 0; - } - if (!get_dev_size(fd, dev, &ldsize)) { - close(fd); - return 0; - } - close(fd); - if (freesize) { - *freesize = avail_size_ddf(st, ldsize >> 9, INVALID_SECTORS); - if (*freesize == 0) - return 0; - } - - return 1; -} - static int validate_geometry_ddf_bvd(struct supertype *st, int level, int layout, int raiddisks, int *chunk, unsigned long long size, From patchwork Thu Jun 9 21:11:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 12875990 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE9EDCCA473 for ; Thu, 9 Jun 2022 21:11:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345429AbiFIVL5 (ORCPT ); Thu, 9 Jun 2022 17:11:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345391AbiFIVLo (ORCPT ); Thu, 9 Jun 2022 17:11:44 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C22626EEA3 for ; Thu, 9 Jun 2022 14:11:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:Cc:To:From:content-disposition; bh=CUai+BYhwX8qDVpPq+JF2gq73b4UAJsSsckC4YJA9bU=; b=TKpLuxqAB/QkV3rz5JNQC+8GRw 3KlJEZXbPkp2VR436ppCW04i0ev/aYKx4UGX40z2qhD+isNjEKX2TTpPrmTwLHO3AgFHiWThj7SHC Xnj5To40jjhu0FtQSbANCR/8W0P8IUIhbq6Wfv2XzZg2JJ3e87XVL5Dm6+MJxnlODLv83nkTPwI6l 3F87YZkUFg7XffulIbhr7CmaUrGJR3LYR1kidGnIGRGncud9Y+GSzA8CTb3AFyFWcoEwTUjToAZLX l1T4+ZV5CkG1rR9/5z+VAOFHaFM7jHSOSGzXi1+N7aN/YnqleKp5iIfoqtvAJ2rTV9wfQ5mt3VWOp yvGMS2pA==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nzPRJ-0037Xn-R4; Thu, 09 Jun 2022 15:11:42 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.94.2) (envelope-from ) id 1nzPRE-0001LX-Hb; Thu, 09 Jun 2022 15:11:32 -0600 From: Logan Gunthorpe To: linux-raid@vger.kernel.org, Jes Sorensen Cc: Song Liu , Christoph Hellwig , Donald Buczek , Guoqing Jiang , Xiao Ni , Himanshu Madhani , Mariusz Tkaczyk , Coly Li , Bruce Dubbs , Stephen Bates , Martin Oliveira , David Sloan , Logan Gunthorpe Date: Thu, 9 Jun 2022 15:11:19 -0600 Message-Id: <20220609211130.5108-4-logang@deltatee.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220609211130.5108-1-logang@deltatee.com> References: <20220609211130.5108-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-raid@vger.kernel.org, jsorensen@fb.com, song@kernel.org, hch@infradead.org, buczek@molgen.mpg.de, guoqing.jiang@linux.dev, xni@redhat.com, himanshu.madhani@oracle.com, mariusz.tkaczyk@linux.intel.com, colyli@suse.de, bruce.dubbs@gmail.com, sbates@raithlin.com, Martin.Oliveira@eideticom.com, David.Sloan@eideticom.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com Subject: [PATCH mdadm v1 03/14] DDF: Fix NULL pointer dereference in validate_geometry_ddf() X-SA-Exim-Version: 4.2.1 (built Sat, 13 Feb 2021 17:57:42 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org A relatively recent patch added a call to validate_geometry() in Manage_add() that has level=LEVEL_CONTAINER and chunk=NULL. This causes some ddf tests to segfault which aborts the test suite. To fix this, avoid dereferencing chunk when the level is LEVEL_CONTAINER or LEVEL_NONE. Fixes: 1f5d54a06df0 ("Manage: Call validate_geometry when adding drive to external container") Cc: Mariusz Tkaczyk Signed-off-by: Logan Gunthorpe Acked-by: Mariusz Tkaczyk --- super-ddf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/super-ddf.c b/super-ddf.c index d3c7a4082046..6bd357cf9b82 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -3369,9 +3369,6 @@ static int validate_geometry_ddf(struct supertype *st, * If given BVDs, we make an SVD, changing all the GUIDs in the process. */ - if (*chunk == UnSet) - *chunk = DEFAULT_CHUNK; - if (level == LEVEL_NONE) level = LEVEL_CONTAINER; if (level == LEVEL_CONTAINER) { @@ -3381,6 +3378,9 @@ static int validate_geometry_ddf(struct supertype *st, freesize, verbose); } + if (*chunk == UnSet) + *chunk = DEFAULT_CHUNK; + if (!dev) { mdu_array_info_t array = { .level = level, From patchwork Thu Jun 9 21:11:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 12875992 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63E9BC433EF for ; Thu, 9 Jun 2022 21:12:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345443AbiFIVL7 (ORCPT ); Thu, 9 Jun 2022 17:11:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345393AbiFIVLo (ORCPT ); Thu, 9 Jun 2022 17:11:44 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D873B26EEBC for ; Thu, 9 Jun 2022 14:11:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:Cc:To:From:content-disposition; bh=0uIwekHGX37VaW1tGHyWJc096HIlPJ7k2WBFvL7dyHY=; b=ACvvx35HsTnD0li6vlIQa755ZE m0bYhBHBq32pB0eRhLiA8HR9HwyIY+I3ZISeJGbA9q8Zifax+QzFTQBkwfxiArboLH0DqWHl4XrEK C2/ZVAu/aM6AWDni4S2t+F7PNjGcDO1CPHEMEiNIsiFNbguqKI5FBgB2yVagMyL/D58zfpW6Ta78x 9xb+aOYrvEBA7m5GZG/oybACtufuteMjam71haVDL+8BldssmJ5K7SQmPgGHVtUbwAMyYzgELCiQP 1rxW6xVd6pGSNSPSvyapbuAd2uWjt9qSofug+GkUmjtNqwqYKD4aMgqTO29mITXQq5NLweK3UHBAu F0SpO4WQ==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nzPRJ-0037Xo-Vs; Thu, 09 Jun 2022 15:11:42 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.94.2) (envelope-from ) id 1nzPRE-0001La-Ku; Thu, 09 Jun 2022 15:11:32 -0600 From: Logan Gunthorpe To: linux-raid@vger.kernel.org, Jes Sorensen Cc: Song Liu , Christoph Hellwig , Donald Buczek , Guoqing Jiang , Xiao Ni , Himanshu Madhani , Mariusz Tkaczyk , Coly Li , Bruce Dubbs , Stephen Bates , Martin Oliveira , David Sloan , Logan Gunthorpe , Alex Wu , BingJing Chang , Danny Shih , ChangSyun Peng Date: Thu, 9 Jun 2022 15:11:20 -0600 Message-Id: <20220609211130.5108-5-logang@deltatee.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220609211130.5108-1-logang@deltatee.com> References: <20220609211130.5108-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-raid@vger.kernel.org, jsorensen@fb.com, song@kernel.org, hch@infradead.org, buczek@molgen.mpg.de, guoqing.jiang@linux.dev, xni@redhat.com, himanshu.madhani@oracle.com, mariusz.tkaczyk@linux.intel.com, colyli@suse.de, bruce.dubbs@gmail.com, sbates@raithlin.com, Martin.Oliveira@eideticom.com, David.Sloan@eideticom.com, logang@deltatee.com, alexwu@synology.com, bingjingc@synology.com, dannyshih@synology.com, allenpeng@synology.com X-SA-Exim-Mail-From: gunthorp@deltatee.com Subject: [PATCH mdadm v1 04/14] mdadm/Grow: Fix use after close bug by closing after fork X-SA-Exim-Version: 4.2.1 (built Sat, 13 Feb 2021 17:57:42 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org The test 07reshape-grow fails most of the time. But it succeeds around 1 in 5 times. When it does succeed, it causes the tests to die because mdadm has segfaulted. The segfault was caused by mdadm attempting to repoen a file descriptor that was already closed. The backtrace of the segfault was: #0 __strncmp_avx2 () at ../sysdeps/x86_64/multiarch/strcmp-avx2.S:101 #1 0x000056146e31d44b in devnm2devid (devnm=0x0) at util.c:956 #2 0x000056146e31dab4 in open_dev_flags (devnm=0x0, flags=0) at util.c:1072 #3 0x000056146e31db22 in open_dev (devnm=0x0) at util.c:1079 #4 0x000056146e3202e8 in reopen_mddev (mdfd=4) at util.c:2244 #5 0x000056146e329f36 in start_array (mdfd=4, mddev=0x7ffc55342450 "/dev/md0", content=0x7ffc55342860, st=0x56146fc78660, ident=0x7ffc55342f70, best=0x56146fc6f5d0, bestcnt=10, chosen_drive=0, devices=0x56146fc706b0, okcnt=5, sparecnt=0, rebuilding_cnt=0, journalcnt=0, c=0x7ffc55342e90, clean=1, avail=0x56146fc78720 "\001\001\001\001\001", start_partial_ok=0, err_ok=0, was_forced=0) at Assemble.c:1206 #6 0x000056146e32c36e in Assemble (st=0x56146fc78660, mddev=0x7ffc55342450 "/dev/md0", ident=0x7ffc55342f70, devlist=0x56146fc6e2d0, c=0x7ffc55342e90) at Assemble.c:1914 #7 0x000056146e312ac9 in main (argc=11, argv=0x7ffc55343238) at mdadm.c:1510 The file descriptor was closed early in Grow_continue(). The noted commit moved the close() call to close the fd above the fork which caused the parent process to return with a closed fd. This meant reshape_array() and Grow_continue() would return in the parent with the fd forked. The fd would eventually be passed to reopen_mddev() which returned an unhandled NULL from fd2devnm() which would then be dereferenced in devnm2devid. Fix this by moving the close() call below the fork. This appears to fix the 07revert-grow test. Fixes: 77b72fa82813 ("mdadm/Grow: prevent md's fd from being occupied during delayed time") Cc: Alex Wu Cc: BingJing Chang Cc: Danny Shih Cc: ChangSyun Peng Signed-off-by: Logan Gunthorpe --- Grow.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Grow.c b/Grow.c index 8a242b0f8725..ba5dc1aead64 100644 --- a/Grow.c +++ b/Grow.c @@ -3506,7 +3506,6 @@ started: return 0; } - close(fd); /* Now we just need to kick off the reshape and watch, while * handling backups of the data... * This is all done by a forked background process. @@ -3527,6 +3526,9 @@ started: break; } + /* Close unused file descriptor in the forked process */ + close(fd); + /* If another array on the same devices is busy, the * reshape will wait for them. This would mean that * the first section that we suspend will stay suspended From patchwork Thu Jun 9 21:11:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 12875993 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E588C43334 for ; Thu, 9 Jun 2022 21:12:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345456AbiFIVME (ORCPT ); Thu, 9 Jun 2022 17:12:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345402AbiFIVLo (ORCPT ); Thu, 9 Jun 2022 17:11:44 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F15523147B for ; Thu, 9 Jun 2022 14:11:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:Cc:To:From:content-disposition; bh=GG1rZbKo/qJ99aa/FfcxamWyPCIJlNyiDLyS0DNm8gY=; b=JgdTkckOqnsbAxE0Ck2gORxgIp Be2PDPXmk6WA0pIV9FW+eaI/yUUJo/uM2PdVNJTR0Rh0YDTXPtsCdAJZw4hYTmFgV4FKr9gad81bh JuUV8J3NV5/PMmN0os5QeandpCG6wwvw81EmX1T7wLmAzvr5HcJMPzOgMGhHR5nUGuaVzEWpJon9+ BckSUcreihHPa9gsiGymeS2u7Msq2OkDvSBiRE4ed56Q8voVKjd9iTZwAvv4C+Pb7Nq5pLcEcvPc1 VjpWdFxWpNNaMcCo82F/o8+WGoon/viCQK0ACjc1Qz67ATdeuOoxcFyMCyuAmk61Ng+ZJlwdBhmYd 7wx+s6FQ==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nzPRO-0037Xm-V1; Thu, 09 Jun 2022 15:11:43 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.94.2) (envelope-from ) id 1nzPRE-0001Ld-PU; Thu, 09 Jun 2022 15:11:32 -0600 From: Logan Gunthorpe To: linux-raid@vger.kernel.org, Jes Sorensen Cc: Song Liu , Christoph Hellwig , Donald Buczek , Guoqing Jiang , Xiao Ni , Himanshu Madhani , Mariusz Tkaczyk , Coly Li , Bruce Dubbs , Stephen Bates , Martin Oliveira , David Sloan , Logan Gunthorpe Date: Thu, 9 Jun 2022 15:11:21 -0600 Message-Id: <20220609211130.5108-6-logang@deltatee.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220609211130.5108-1-logang@deltatee.com> References: <20220609211130.5108-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-raid@vger.kernel.org, jsorensen@fb.com, song@kernel.org, hch@infradead.org, buczek@molgen.mpg.de, guoqing.jiang@linux.dev, xni@redhat.com, himanshu.madhani@oracle.com, mariusz.tkaczyk@linux.intel.com, colyli@suse.de, bruce.dubbs@gmail.com, sbates@raithlin.com, Martin.Oliveira@eideticom.com, David.Sloan@eideticom.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com Subject: [PATCH mdadm v1 05/14] monitor: Avoid segfault when calling NULL get_bad_blocks X-SA-Exim-Version: 4.2.1 (built Sat, 13 Feb 2021 17:57:42 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org Not all struct superswitch implement a get_bad_blocks() function, yet mdmon seems to call it without checking for NULL and thus occasionally segfaults in the test 10ddf-geometry. Fix this by checking for NULL before calling it. Signed-off-by: Logan Gunthorpe Acked-by: Mariusz Tkaczyk --- monitor.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/monitor.c b/monitor.c index b877e595c998..820a93d0ceaf 100644 --- a/monitor.c +++ b/monitor.c @@ -311,6 +311,9 @@ static int check_for_cleared_bb(struct active_array *a, struct mdinfo *mdi) struct md_bb *bb; int i; + if (!ss->get_bad_blocks) + return -1; + /* * Get a list of bad blocks for an array, then read list of * acknowledged bad blocks from kernel and compare it against metadata From patchwork Thu Jun 9 21:11:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 12875995 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8FF79C433EF for ; Thu, 9 Jun 2022 21:12:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345401AbiFIVMH (ORCPT ); Thu, 9 Jun 2022 17:12:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235695AbiFIVLp (ORCPT ); Thu, 9 Jun 2022 17:11:45 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 257DDA98A7 for ; Thu, 9 Jun 2022 14:11:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:Cc:To:From:content-disposition; bh=lPks7c6lyNFNFbL+1sGNutaODjae1l+U/zuxN3QBde4=; b=QBxcm3fM81Ythxb26Iy/ehDMBs kX+HGm0DeQVB6vTegUiHJxxMfxRvw20C9kuAurvFMp2tGY8fusmAh8veJn6KixN9yEO0+JGAwjHF9 gani5j3z743LSjvzadwYmYH9GnCy3QS0IQ5WHeWrxdnqUBheCZmswppJo1TakDSB6zrT4RoGihHTw vrepTbOp7+X0vm4HeEVspExIoSVPvFvNP9e5yomk5cIhVw6C+SngGsuheI4YMN2Ti3qT0yQL4AchS OluU2HvQB5SXcM/vjE1q/493pnfQCfTsD0UGkKy9E9w2kBAo3ij8ExcTK/swQNyxmiB3Z1bxamk9k jzP6DdEA==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nzPRP-0037Xk-Ot; Thu, 09 Jun 2022 15:11:44 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.94.2) (envelope-from ) id 1nzPRE-0001Lg-U4; Thu, 09 Jun 2022 15:11:32 -0600 From: Logan Gunthorpe To: linux-raid@vger.kernel.org, Jes Sorensen Cc: Song Liu , Christoph Hellwig , Donald Buczek , Guoqing Jiang , Xiao Ni , Himanshu Madhani , Mariusz Tkaczyk , Coly Li , Bruce Dubbs , Stephen Bates , Martin Oliveira , David Sloan , Logan Gunthorpe , Wu Guanghao Date: Thu, 9 Jun 2022 15:11:22 -0600 Message-Id: <20220609211130.5108-7-logang@deltatee.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220609211130.5108-1-logang@deltatee.com> References: <20220609211130.5108-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-raid@vger.kernel.org, jsorensen@fb.com, song@kernel.org, hch@infradead.org, buczek@molgen.mpg.de, guoqing.jiang@linux.dev, xni@redhat.com, himanshu.madhani@oracle.com, mariusz.tkaczyk@linux.intel.com, colyli@suse.de, bruce.dubbs@gmail.com, sbates@raithlin.com, Martin.Oliveira@eideticom.com, David.Sloan@eideticom.com, logang@deltatee.com, wuguanghao3@huawei.com X-SA-Exim-Mail-From: gunthorp@deltatee.com Subject: [PATCH mdadm v1 06/14] mdadm: Fix mdadm -r remove option regresision X-SA-Exim-Version: 4.2.1 (built Sat, 13 Feb 2021 17:57:42 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org The commit noted below globally adds a parameter to the -r option but missed the fact that -r is used for another purpose: --remove. After that commit, a command such as: mdadm /dev/md0 -r /dev/loop0 will do nothing seeing the device parameter will be consumed as a argument to the -r option; thus, there will only be one device seen one the command line, devs_found will only be 1 and nothing will happen. This caused the 01r5integ and 01raid6integ tests to hang indefinitely as mdadm did not remove the failed device. With the device not removed, it would not be readded. Then the loop waiting for the array status to change would loop forever. To fix this, revert the changes in the noted patch and create a new subopt type for the monitor mode with parameters required for -r. Fixes: 546047688e1c ("mdadm: fix coredump of mdadm --monitor -r") Cc: Wu Guanghao Cc: Mariusz Tkaczyk Signed-off-by: Logan Gunthorpe --- ReadMe.c | 7 ++++--- mdadm.c | 1 + mdadm.h | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ReadMe.c b/ReadMe.c index 8f873c4895da..556104f75d72 100644 --- a/ReadMe.c +++ b/ReadMe.c @@ -81,11 +81,12 @@ char Version[] = "mdadm - v" VERSION " - " VERS_DATE EXTRAVERSION "\n"; * found, it is started. */ -char short_options[]="-ABCDEFGIQhVXYWZ:vqbc:i:l:p:m:r:n:x:u:c:d:z:U:N:safRSow1tye:k"; +char short_options[]="-ABCDEFGIQhVXYWZ:vqbc:i:l:p:m:n:x:u:c:d:z:U:N:sarfRSow1tye:k"; +char short_monitor_options[]="-ABCDEFGIQhVXYWZ:vqbc:i:l:p:m:r:n:x:u:c:d:z:U:N:safRSow1tye:k"; char short_bitmap_options[]= - "-ABCDEFGIQhVXYWZ:vqb:c:i:l:p:m:r:n:x:u:c:d:z:U:N:sarfRSow1tye:k:"; + "-ABCDEFGIQhVXYWZ:vqb:c:i:l:p:m:n:x:u:c:d:z:U:N:sarfRSow1tye:k:"; char short_bitmap_auto_options[]= - "-ABCDEFGIQhVXYWZ:vqb:c:i:l:p:m:r:n:x:u:c:d:z:U:N:sa:rfRSow1tye:k:"; + "-ABCDEFGIQhVXYWZ:vqb:c:i:l:p:m:n:x:u:c:d:z:U:N:sa:rfRSow1tye:k:"; struct option long_options[] = { {"manage", 0, 0, ManageOpt}, diff --git a/mdadm.c b/mdadm.c index be40686cf91b..d0c5e6def901 100644 --- a/mdadm.c +++ b/mdadm.c @@ -227,6 +227,7 @@ int main(int argc, char *argv[]) shortopt = short_bitmap_auto_options; break; case 'F': newmode = MONITOR; + shortopt = short_monitor_options; break; case 'G': newmode = GROW; shortopt = short_bitmap_options; diff --git a/mdadm.h b/mdadm.h index 09915a0009d9..559da3f6f440 100644 --- a/mdadm.h +++ b/mdadm.h @@ -419,6 +419,7 @@ enum mode { }; extern char short_options[]; +extern char short_monitor_options[]; extern char short_bitmap_options[]; extern char short_bitmap_auto_options[]; extern struct option long_options[]; From patchwork Thu Jun 9 21:11:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 12875994 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D004C43334 for ; Thu, 9 Jun 2022 21:12:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345457AbiFIVMF (ORCPT ); Thu, 9 Jun 2022 17:12:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345401AbiFIVLo (ORCPT ); Thu, 9 Jun 2022 17:11:44 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BC0F4D634 for ; Thu, 9 Jun 2022 14:11:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:Cc:To:From:content-disposition; bh=qd6TfGvL/Y0MJdGtXjnb4Fd0waxIllFwwtDttAwg+sM=; b=sI/aOsXO/0a/9P7xVIInA9Qw1x qLNljWm3t1sI0/y2/EtkRBf4PSI9TAJnZsQhRHLIUbrvLgOmXCvn12LOhxpUsf4+CRMIpePh64mpV BpTSCfbwEg8+8rYM07PhYLiQ2DatshgTN4ZZ8lmEEBk+IsVqo0cvdlfA1qzyIfNfKCUQ/Y7PDV7Ow DsLHVffHMKXUbSN0liK/rNrdb00BOnd37PORU4cDsvNgq42P8YDqCtlNhF6TOKc6psDvZd9emG6+i WowZMcOtK9r1TGb7TcjzzNcv2CPsYeeV1oN+UQTkHPd61jPtb2XBQ6qYFFKXUczzbF+s94oV3H3t6 oyW3b3sQ==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nzPRO-0037Xl-KY; Thu, 09 Jun 2022 15:11:43 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.94.2) (envelope-from ) id 1nzPRF-0001Lj-1G; Thu, 09 Jun 2022 15:11:33 -0600 From: Logan Gunthorpe To: linux-raid@vger.kernel.org, Jes Sorensen Cc: Song Liu , Christoph Hellwig , Donald Buczek , Guoqing Jiang , Xiao Ni , Himanshu Madhani , Mariusz Tkaczyk , Coly Li , Bruce Dubbs , Stephen Bates , Martin Oliveira , David Sloan , Logan Gunthorpe , Mateusz Grzonka Date: Thu, 9 Jun 2022 15:11:23 -0600 Message-Id: <20220609211130.5108-8-logang@deltatee.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220609211130.5108-1-logang@deltatee.com> References: <20220609211130.5108-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-raid@vger.kernel.org, jsorensen@fb.com, song@kernel.org, hch@infradead.org, buczek@molgen.mpg.de, guoqing.jiang@linux.dev, xni@redhat.com, himanshu.madhani@oracle.com, mariusz.tkaczyk@linux.intel.com, colyli@suse.de, bruce.dubbs@gmail.com, sbates@raithlin.com, Martin.Oliveira@eideticom.com, David.Sloan@eideticom.com, logang@deltatee.com, mateusz.grzonka@intel.com X-SA-Exim-Mail-From: gunthorp@deltatee.com Subject: [PATCH mdadm v1 07/14] mdadm: Fix optional --write-behind parameter X-SA-Exim-Version: 4.2.1 (built Sat, 13 Feb 2021 17:57:42 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org The commit noted below changed the behaviour of --write-behind to require an argument. This broke the 06wrmostly test with the error: mdadm: Invalid value for maximum outstanding write-behind writes: (null). Must be between 0 and 16383. To fix this, check if optarg is NULL before parising it, as the origial code did. Fixes: 60815698c0ac ("Refactor parse_num and use it to parse optarg.") Cc: Mateusz Grzonka Signed-off-by: Logan Gunthorpe Acked-by: Mariusz Tkaczyk --- mdadm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mdadm.c b/mdadm.c index d0c5e6def901..56722ed997a2 100644 --- a/mdadm.c +++ b/mdadm.c @@ -1201,8 +1201,9 @@ int main(int argc, char *argv[]) case O(BUILD, WriteBehind): case O(CREATE, WriteBehind): s.write_behind = DEFAULT_MAX_WRITE_BEHIND; - if (parse_num(&s.write_behind, optarg) != 0 || - s.write_behind < 0 || s.write_behind > 16383) { + if (optarg && + (parse_num(&s.write_behind, optarg) != 0 || + s.write_behind < 0 || s.write_behind > 16383)) { pr_err("Invalid value for maximum outstanding write-behind writes: %s.\n\tMust be between 0 and 16383.\n", optarg); exit(2); From patchwork Thu Jun 9 21:11:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 12875989 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F8D9C43334 for ; Thu, 9 Jun 2022 21:11:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345423AbiFIVL4 (ORCPT ); Thu, 9 Jun 2022 17:11:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345381AbiFIVLo (ORCPT ); Thu, 9 Jun 2022 17:11:44 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9455C26E92F for ; Thu, 9 Jun 2022 14:11:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:Cc:To:From:content-disposition; bh=jRp3SM7RH3XEZbQpMQA5f2N3ArXh8hGpvX2L5gF7mKo=; b=omNcalOZFisLXlT963K6nFEWnO jYUND76peOSgGC23N2baqNII3bzd8GXRsyRz2wxbgAjE8g/kjsrRpOhAfgh/iymcrLkaqUewB2WeZ mJvde9msWVKi0QHAf8HBTUjIgn9A3UtmhFK2FyEnGAQMr5yCqhI1QOATWc/R8+YBvbz3jPcouusUo hBnHCJfOk5VdYucI8+2mILIlvDa6iiwfjOgx8Rcvf2XNSYIPQ2DFNS3pEOkgzD16vx6aNvavop5lS ZyfHQxE4fWyTbCsOGIVGGrwsL8an5eVGeBj427cUD3i9yEfHO5A8ACMEb1s4WBK/ryB7dAxw3Da5+ vvPkHMOw==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nzPRO-0037Xk-6G; Thu, 09 Jun 2022 15:11:42 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.94.2) (envelope-from ) id 1nzPRF-0001Lm-54; Thu, 09 Jun 2022 15:11:33 -0600 From: Logan Gunthorpe To: linux-raid@vger.kernel.org, Jes Sorensen Cc: Song Liu , Christoph Hellwig , Donald Buczek , Guoqing Jiang , Xiao Ni , Himanshu Madhani , Mariusz Tkaczyk , Coly Li , Bruce Dubbs , Stephen Bates , Martin Oliveira , David Sloan , Sudhakar Panneerselvam , Logan Gunthorpe Date: Thu, 9 Jun 2022 15:11:24 -0600 Message-Id: <20220609211130.5108-9-logang@deltatee.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220609211130.5108-1-logang@deltatee.com> References: <20220609211130.5108-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-raid@vger.kernel.org, jsorensen@fb.com, song@kernel.org, hch@infradead.org, buczek@molgen.mpg.de, guoqing.jiang@linux.dev, xni@redhat.com, mariusz.tkaczyk@linux.intel.com, colyli@suse.de, bruce.dubbs@gmail.com, sbates@raithlin.com, Martin.Oliveira@eideticom.com, David.Sloan@eideticom.com, himanshu.madhani@oracle.com, sudhakar.panneerselvam@oracle.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com Subject: [PATCH mdadm v1 08/14] tests/00raid0: add a test that validates raid0 with layout fails for 0.9 X-SA-Exim-Version: 4.2.1 (built Sat, 13 Feb 2021 17:57:42 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org From: Sudhakar Panneerselvam 329dfc28debb disallows the creation of raid0 with layouts for 0.9 metadata. This test confirms the new behavior. Signed-off-by: Sudhakar Panneerselvam Signed-off-by: Himanshu Madhani Signed-off-by: Logan Gunthorpe --- tests/00raid0 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/00raid0 b/tests/00raid0 index 8bc18985f91a..e6b21cc419eb 100644 --- a/tests/00raid0 +++ b/tests/00raid0 @@ -6,11 +6,9 @@ check raid0 testdev $md0 3 $mdsize2_l 512 mdadm -S $md0 -# now with version-0.90 superblock +# verify raid0 with layouts fail for 0.90 mdadm -CR $md0 -e0.90 -l0 -n4 $dev0 $dev1 $dev2 $dev3 -check raid0 -testdev $md0 4 $mdsize0 512 -mdadm -S $md0 +check opposite_result # now with no superblock mdadm -B $md0 -l0 -n5 $dev0 $dev1 $dev2 $dev3 $dev4 From patchwork Thu Jun 9 21:11:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 12875988 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AAB5C433EF for ; Thu, 9 Jun 2022 21:11:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345413AbiFIVLx (ORCPT ); Thu, 9 Jun 2022 17:11:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345378AbiFIVLo (ORCPT ); Thu, 9 Jun 2022 17:11:44 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B772152D96 for ; Thu, 9 Jun 2022 14:11:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:Cc:To:From:content-disposition; bh=9XsLn8P/ZHyuehC/8bpzEu5IbWvJqS53bLSU/ZPvPKU=; b=s1QW3WbWL+8VASJxylAET4vTEC JzP2O0pkqNlYA6G4xoq5S9cJh3xwgfInMArnMgF5iqrEzEOzOb29RW5AvrZkkgMMl8D8JKd8QHu4e 9emwKd8QOhOWhF/5RO4WXFpDJua0PxJi2ONxi/VaZHvsmk6RfnT2uxBg3FayFEmBaAqh9+KiBsi9x 2y2pq3uNwOZHc2dffODvw7+WezQOoxJsbsOgfAN+C48Ad4LffQ9tGY41iDeQg11PlyVLRMPO+re51 NprW0cOiyagIhkwsK0KMKN2q8aJqVo9DE/9dPZztq6I0NOYciKcevvPGxuPQQXRTzDdA68xK98G4r F7fzUGtg==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nzPRM-0037Xk-O8; Thu, 09 Jun 2022 15:11:42 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.94.2) (envelope-from ) id 1nzPRF-0001Lr-A3; Thu, 09 Jun 2022 15:11:33 -0600 From: Logan Gunthorpe To: linux-raid@vger.kernel.org, Jes Sorensen Cc: Song Liu , Christoph Hellwig , Donald Buczek , Guoqing Jiang , Xiao Ni , Himanshu Madhani , Mariusz Tkaczyk , Coly Li , Bruce Dubbs , Stephen Bates , Martin Oliveira , David Sloan , Sudhakar Panneerselvam , Logan Gunthorpe Date: Thu, 9 Jun 2022 15:11:25 -0600 Message-Id: <20220609211130.5108-10-logang@deltatee.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220609211130.5108-1-logang@deltatee.com> References: <20220609211130.5108-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-raid@vger.kernel.org, jsorensen@fb.com, song@kernel.org, hch@infradead.org, buczek@molgen.mpg.de, guoqing.jiang@linux.dev, xni@redhat.com, mariusz.tkaczyk@linux.intel.com, colyli@suse.de, bruce.dubbs@gmail.com, sbates@raithlin.com, Martin.Oliveira@eideticom.com, David.Sloan@eideticom.com, himanshu.madhani@oracle.com, sudhakar.panneerselvam@oracle.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com Subject: [PATCH mdadm v1 09/14] tests: fix raid0 tests for 0.90 metadata X-SA-Exim-Version: 4.2.1 (built Sat, 13 Feb 2021 17:57:42 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org From: Sudhakar Panneerselvam Some of the test cases fail because raid0 creation fails with the error, "0.90 metadata does not support layouts for RAID0" added by commit, 329dfc28debb. Fix some of the test cases by switching from raid0 to linear level for 0.9 metadata where possible. Signed-off-by: Sudhakar Panneerselvam Signed-off-by: Himanshu Madhani Signed-off-by: Logan Gunthorpe --- tests/00raid0 | 4 ++-- tests/00readonly | 4 ++++ tests/03r0assem | 6 +++--- tests/04r0update | 4 ++-- tests/04update-metadata | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/00raid0 b/tests/00raid0 index e6b21cc419eb..9b8896cbdc52 100644 --- a/tests/00raid0 +++ b/tests/00raid0 @@ -20,8 +20,8 @@ mdadm -S $md0 # now same again with different chunk size for chunk in 4 32 256 do - mdadm -CR $md0 -e0.90 -l raid0 --chunk $chunk -n3 $dev0 $dev1 $dev2 - check raid0 + mdadm -CR $md0 -e0.90 -l linear --chunk $chunk -n3 $dev0 $dev1 $dev2 + check linear testdev $md0 3 $mdsize0 $chunk mdadm -S $md0 diff --git a/tests/00readonly b/tests/00readonly index 28b0fa13f815..39202487f614 100644 --- a/tests/00readonly +++ b/tests/00readonly @@ -4,6 +4,10 @@ for metadata in 0.9 1.0 1.1 1.2 do for level in linear raid0 raid1 raid4 raid5 raid6 raid10 do + if [[ $metadata == "0.9" && $level == "raid0" ]]; + then + continue + fi mdadm -CR $md0 -l $level -n 4 --metadata=$metadata \ $dev1 $dev2 $dev3 $dev4 --assume-clean check nosync diff --git a/tests/03r0assem b/tests/03r0assem index 6744e3221062..44df06456233 100644 --- a/tests/03r0assem +++ b/tests/03r0assem @@ -68,9 +68,9 @@ mdadm -S $md2 ### Now for version 0... mdadm --zero-superblock $dev0 $dev1 $dev2 -mdadm -CR $md2 -l0 --metadata=0.90 -n3 $dev0 $dev1 $dev2 -check raid0 -tst="testdev $md2 3 $mdsize0 512" +mdadm -CR $md2 -llinear --metadata=0.90 -n3 $dev0 $dev1 $dev2 +check linear +tst="testdev $md2 3 $mdsize0 1" $tst uuid=`mdadm -Db $md2 | sed 's/.*UUID=//'` diff --git a/tests/04r0update b/tests/04r0update index 73ee3b9fed91..b95efb06c761 100644 --- a/tests/04r0update +++ b/tests/04r0update @@ -1,7 +1,7 @@ # create a raid0, re-assemble with a different super-minor -mdadm -CR -e 0.90 $md0 -l0 -n3 $dev0 $dev1 $dev2 -testdev $md0 3 $mdsize0 512 +mdadm -CR -e 0.90 $md0 -llinear -n3 $dev0 $dev1 $dev2 +testdev $md0 3 $mdsize0 1 minor1=`mdadm -E $dev0 | sed -n -e 's/.*Preferred Minor : //p'` mdadm -S /dev/md0 diff --git a/tests/04update-metadata b/tests/04update-metadata index 232fc1ffff4b..08c14af7ed29 100644 --- a/tests/04update-metadata +++ b/tests/04update-metadata @@ -8,7 +8,7 @@ set -xe dlist="$dev0 $dev1 $dev2 $dev3" -for ls in raid0/4 linear/4 raid1/1 raid5/3 raid6/2 +for ls in linear/4 raid1/1 raid5/3 raid6/2 do s=${ls#*/} l=${ls%/*} mdadm -CR --assume-clean -e 0.90 $md0 --level $l -n 4 -c 64 $dlist From patchwork Thu Jun 9 21:11:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 12875986 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E5BCC43334 for ; Thu, 9 Jun 2022 21:11:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345121AbiFIVLv (ORCPT ); Thu, 9 Jun 2022 17:11:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345361AbiFIVLo (ORCPT ); Thu, 9 Jun 2022 17:11:44 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A6BC26E909 for ; Thu, 9 Jun 2022 14:11:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:Cc:To:From:content-disposition; bh=jp66Uj0KPYNCtqYBFltKo8R5KGhIAqhSkkfIBhcMyHw=; b=elg6WNF4PkMkxv+P7LttJ7TX3W rPzIlCvrPRHSAvnp1/Q4Y4p64WcDzNqkoyONzbdYlxGKcAiDdlesS1NxWGwAn4iKMsg1utpHqOrOT mLxr5OFj1lzsv/V/w/Ev/PORtYFgKluXRPDTV75RHpGuMS8UDvb1T0xznHkFtkZpTnx70PVr3hRPI R+uHHh5KkFIdCuSBGBYUENXklrg9WtZ/W1rQmQ4HBLyY5a3wTSL4/AwObmSsIoa04/NZnmHBcbTQU g4YtKTLO681pPOPswO80qA8TJYVAq5XuDVYwsn6QRP3HBKAMCZqaC/80EIfHIk+RQTiWWBOONLJs3 FNVrauhw==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nzPRM-0037Xl-8H; Thu, 09 Jun 2022 15:11:40 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.94.2) (envelope-from ) id 1nzPRF-0001Lw-H7; Thu, 09 Jun 2022 15:11:33 -0600 From: Logan Gunthorpe To: linux-raid@vger.kernel.org, Jes Sorensen Cc: Song Liu , Christoph Hellwig , Donald Buczek , Guoqing Jiang , Xiao Ni , Himanshu Madhani , Mariusz Tkaczyk , Coly Li , Bruce Dubbs , Stephen Bates , Martin Oliveira , David Sloan , Sudhakar Panneerselvam , Logan Gunthorpe Date: Thu, 9 Jun 2022 15:11:26 -0600 Message-Id: <20220609211130.5108-11-logang@deltatee.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220609211130.5108-1-logang@deltatee.com> References: <20220609211130.5108-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-raid@vger.kernel.org, jsorensen@fb.com, song@kernel.org, hch@infradead.org, buczek@molgen.mpg.de, guoqing.jiang@linux.dev, xni@redhat.com, mariusz.tkaczyk@linux.intel.com, colyli@suse.de, bruce.dubbs@gmail.com, sbates@raithlin.com, Martin.Oliveira@eideticom.com, David.Sloan@eideticom.com, himanshu.madhani@oracle.com, sudhakar.panneerselvam@oracle.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com Subject: [PATCH mdadm v1 10/14] tests/04update-metadata: avoid passing chunk size to raid1 X-SA-Exim-Version: 4.2.1 (built Sat, 13 Feb 2021 17:57:42 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org From: Sudhakar Panneerselvam '04update-metadata' test fails with error, "specifying chunk size is forbidden for this level" added by commit, 5b30a34aa4b5e. Hence, correcting the test to ignore passing chunk size to raid1. Signed-off-by: Sudhakar Panneerselvam Signed-off-by: Himanshu Madhani [logang@deltatee.com: fix if/then style and dropped unrelated hunk] Signed-off-by: Logan Gunthorpe --- tests/04update-metadata | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/04update-metadata b/tests/04update-metadata index 08c14af7ed29..2b72a303b6a0 100644 --- a/tests/04update-metadata +++ b/tests/04update-metadata @@ -11,7 +11,11 @@ dlist="$dev0 $dev1 $dev2 $dev3" for ls in linear/4 raid1/1 raid5/3 raid6/2 do s=${ls#*/} l=${ls%/*} - mdadm -CR --assume-clean -e 0.90 $md0 --level $l -n 4 -c 64 $dlist + if [[ $l == 'raid1' ]]; then + mdadm -CR --assume-clean -e 0.90 $md0 --level $l -n 4 $dlist + else + mdadm -CR --assume-clean -e 0.90 $md0 --level $l -n 4 -c 64 $dlist + fi testdev $md0 $s 19904 64 mdadm -S $md0 mdadm -A $md0 --update=metadata $dlist From patchwork Thu Jun 9 21:11:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 12875985 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D322CC433EF for ; Thu, 9 Jun 2022 21:11:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345377AbiFIVLt (ORCPT ); Thu, 9 Jun 2022 17:11:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345121AbiFIVLn (ORCPT ); Thu, 9 Jun 2022 17:11:43 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 077BA26D89C for ; Thu, 9 Jun 2022 14:11:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:Cc:To:From:content-disposition; bh=5dbV102Q994V1lyNgmKcn4tb5fiwa3NLzz1hJcS0cnE=; b=dSUN7slw4b32FQZpVAj1kLS2cj IuJmBoeG1k2hgtq2SHXZcE6cr3kuTnBAaArLEL/jAg7FlhoY4I2+fpIFnaOMmrqNsAPsFf2aZwu3p SJyDMvSPPoTGSX6khMfXc0f4z5Pd7mFiLHw/U9E4K9JwvN6U+DVpuwLngmo6ipPFiTzn8HuY48bv2 UOzoMSdopsUIT3RBmXQwVxYbvEk185bvImDeUzlACMPVonACwq7iR1bBQlG6WA7I3472RPEZwqXrg efDgXMwV+a6g0G/BNGW1hZeqO7fNtMv42Klo8L0cgmJgeHokAmyfjQla2AnZJRU8f13OZ1ZaWC37l XjmEX0vQ==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nzPRM-0037Xk-2T; Thu, 09 Jun 2022 15:11:40 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.94.2) (envelope-from ) id 1nzPRF-0001M0-Lz; Thu, 09 Jun 2022 15:11:33 -0600 From: Logan Gunthorpe To: linux-raid@vger.kernel.org, Jes Sorensen Cc: Song Liu , Christoph Hellwig , Donald Buczek , Guoqing Jiang , Xiao Ni , Himanshu Madhani , Mariusz Tkaczyk , Coly Li , Bruce Dubbs , Stephen Bates , Martin Oliveira , David Sloan , Sudhakar Panneerselvam , Logan Gunthorpe Date: Thu, 9 Jun 2022 15:11:27 -0600 Message-Id: <20220609211130.5108-12-logang@deltatee.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220609211130.5108-1-logang@deltatee.com> References: <20220609211130.5108-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-raid@vger.kernel.org, jsorensen@fb.com, song@kernel.org, hch@infradead.org, buczek@molgen.mpg.de, guoqing.jiang@linux.dev, xni@redhat.com, mariusz.tkaczyk@linux.intel.com, colyli@suse.de, bruce.dubbs@gmail.com, sbates@raithlin.com, Martin.Oliveira@eideticom.com, David.Sloan@eideticom.com, himanshu.madhani@oracle.com, sudhakar.panneerselvam@oracle.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com Subject: [PATCH mdadm v1 11/14] tests/02lineargrow: clear the superblock at every iteration X-SA-Exim-Version: 4.2.1 (built Sat, 13 Feb 2021 17:57:42 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org From: Sudhakar Panneerselvam This fixes 02lineargrow test as prior metadata causes --add operation to misbehave. Signed-off-by: Sudhakar Panneerselvam Signed-off-by: Himanshu Madhani Signed-off-by: Logan Gunthorpe --- tests/02lineargrow | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/02lineargrow b/tests/02lineargrow index e05c219d113a..595bf9f20802 100644 --- a/tests/02lineargrow +++ b/tests/02lineargrow @@ -20,4 +20,6 @@ do testdev $md0 3 $sz 1 mdadm -S $md0 + mdadm --zero /dev/loop2 + mdadm --zero /dev/loop3 done From patchwork Thu Jun 9 21:11:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 12875991 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F299AC433EF for ; Thu, 9 Jun 2022 21:11:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345434AbiFIVL6 (ORCPT ); Thu, 9 Jun 2022 17:11:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345382AbiFIVLo (ORCPT ); Thu, 9 Jun 2022 17:11:44 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9636726EE99 for ; Thu, 9 Jun 2022 14:11:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:Cc:To:From:content-disposition; bh=+JRZ9g54SAu+siTWbS9T+HaWBQFQ+/nBsrVAy1s0Bnw=; b=aY+3F2y86HsLz2IuPPIe8+F6Gs RH5jUYciOn9K/ApwbVOq5GmFFow5gSazekDhSihetVDEXn2us4fwzUsdAqqtwUH/RQ48kP9wWfggL tFWcfWBohiM1PhCd2KGqj90dIjpz9Q03Dm17rvYgiFi0ye4aH52zlnloPEZzHI2xFGiEzdTJkDWNd QqgMntliRUBuBWxNSYBxIkuhc+fFMWU48kDs+WzaTrwpM2WswDErBj8mxG9225uYJ2nJY4Ssab3FS ia6/FyjnAUqS2QJ4gA00FsvykYEqre8HlmHVuiLk0ScR1tGnAAyV9gDSlvjHp9Ggwn6B2cXody4hs S2VhupfQ==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nzPRL-0037Xm-8J; Thu, 09 Jun 2022 15:11:42 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.94.2) (envelope-from ) id 1nzPRF-0001M4-QH; Thu, 09 Jun 2022 15:11:33 -0600 From: Logan Gunthorpe To: linux-raid@vger.kernel.org, Jes Sorensen Cc: Song Liu , Christoph Hellwig , Donald Buczek , Guoqing Jiang , Xiao Ni , Himanshu Madhani , Mariusz Tkaczyk , Coly Li , Bruce Dubbs , Stephen Bates , Martin Oliveira , David Sloan , Logan Gunthorpe Date: Thu, 9 Jun 2022 15:11:28 -0600 Message-Id: <20220609211130.5108-13-logang@deltatee.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220609211130.5108-1-logang@deltatee.com> References: <20220609211130.5108-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-raid@vger.kernel.org, jsorensen@fb.com, song@kernel.org, hch@infradead.org, buczek@molgen.mpg.de, guoqing.jiang@linux.dev, xni@redhat.com, himanshu.madhani@oracle.com, mariusz.tkaczyk@linux.intel.com, colyli@suse.de, bruce.dubbs@gmail.com, sbates@raithlin.com, Martin.Oliveira@eideticom.com, David.Sloan@eideticom.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com Subject: [PATCH mdadm v1 12/14] mdadm/test: Add a mode to repeat specified tests X-SA-Exim-Version: 4.2.1 (built Sat, 13 Feb 2021 17:57:42 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org Many tests fail infrequently or rarely. To help find these, add an option to run the tests multiple times by specifying --loop=N. If --loop=0 is specified, the test will be looped forever. Signed-off-by: Logan Gunthorpe --- test | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/test b/test index 711a3c7a2076..da6db5e0f631 100755 --- a/test +++ b/test @@ -10,6 +10,7 @@ devlist= savelogs=0 exitonerror=1 +loop=1 prefix='[0-9][0-9]' # use loop devices by default if doesn't specify --dev @@ -117,6 +118,7 @@ do_help() { --logdir=directory Directory to save all logfiles in --save-logs Usually use with --logdir together --keep-going | --no-error Don't stop on error, ie. run all tests + --loop=N Run tests N times (0 to run forever) --dev=loop|lvm|ram|disk Use loop devices (default), LVM, RAM or disk --disks= Provide a bunch of physical devices for test --volgroup=name LVM volume group for LVM test @@ -211,6 +213,9 @@ parse_args() { --keep-going | --no-error ) exitonerror=0 ;; + --loop=* ) + loop="${i##*=}" + ;; --disable-multipath ) unset MULTIPATH ;; @@ -263,19 +268,26 @@ main() { echo "Testing on linux-$(uname -r) kernel" [ "$savelogs" == "1" ] && echo "Saving logs to $logdir" - if [ "x$TESTLIST" != "x" ] - then - for script in ${TESTLIST[@]} - do - do_test $testdir/$script - done - else - for script in $testdir/$prefix $testdir/$prefix*[^~] - do - do_test $script - done - fi + while true; do + if [ "x$TESTLIST" != "x" ] + then + for script in ${TESTLIST[@]} + do + do_test $testdir/$script + done + else + for script in $testdir/$prefix $testdir/$prefix*[^~] + do + do_test $script + done + fi + + let loop=$loop-1 + if [ "$loop" == "0" ]; then + break + fi + done exit 0 } From patchwork Thu Jun 9 21:11:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 12875981 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40EE7C433EF for ; Thu, 9 Jun 2022 21:11:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244861AbiFIVLo (ORCPT ); Thu, 9 Jun 2022 17:11:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235284AbiFIVLn (ORCPT ); Thu, 9 Jun 2022 17:11:43 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCD9A26D900 for ; Thu, 9 Jun 2022 14:11:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:Cc:To:From:content-disposition; bh=Izv7CasWdRxZdbqaq8iettcLBBTlXt66MwXBRskp2P0=; b=NiI29QKEYM5oZC23Gqb86KMAlI sCQJlM+i9a147xre/oOVZqBTACaCyhsQ3akWTmXERY7yiMk9BwRaPtNdSe63faZc+e+0RkjtSrjJ5 BZ9vgs89WJietnI+iwoTdniUlhTWQ4nbjXtNYZ7O7zVe6Heremt8o6akqiAkK/zu8CgFaoFMkPNol tA6E0+js0WtBHCAZziLDR2rnlqGAN0ralAi2I1rS3HhKvqNcng2HSkv+tF1XsvnKLBgsEWwWDAd0C f7qivPck8KrASVW4bxWTCp/wsk+MGXFwxFqRVJAGfIQz9YmUyXr0n5GKuJJkokv6vN86i5XnNMen/ uM8ZvFZw==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nzPRL-0037Xk-1x; Thu, 09 Jun 2022 15:11:39 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.94.2) (envelope-from ) id 1nzPRF-0001M8-V8; Thu, 09 Jun 2022 15:11:34 -0600 From: Logan Gunthorpe To: linux-raid@vger.kernel.org, Jes Sorensen Cc: Song Liu , Christoph Hellwig , Donald Buczek , Guoqing Jiang , Xiao Ni , Himanshu Madhani , Mariusz Tkaczyk , Coly Li , Bruce Dubbs , Stephen Bates , Martin Oliveira , David Sloan , Logan Gunthorpe Date: Thu, 9 Jun 2022 15:11:29 -0600 Message-Id: <20220609211130.5108-14-logang@deltatee.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220609211130.5108-1-logang@deltatee.com> References: <20220609211130.5108-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-raid@vger.kernel.org, jsorensen@fb.com, song@kernel.org, hch@infradead.org, buczek@molgen.mpg.de, guoqing.jiang@linux.dev, xni@redhat.com, himanshu.madhani@oracle.com, mariusz.tkaczyk@linux.intel.com, colyli@suse.de, bruce.dubbs@gmail.com, sbates@raithlin.com, Martin.Oliveira@eideticom.com, David.Sloan@eideticom.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com Subject: [PATCH mdadm v1 13/14] mdadm/test: Mark and ignore broken test failures X-SA-Exim-Version: 4.2.1 (built Sat, 13 Feb 2021 17:57:42 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org Add functionality to continue if a test marked as broken fails. To mark a test as broken, a file with the same name but with the suffix '.broken' should exist. The first line in the file will be printed with a KNOWN BROKEN message; the rest of the file can describe the how the test is broken. Also adds --skip-broken and --skip-always-broken to skip all the tests that have a .broken file or to skip all tests whose .broken file's first line contains the keyword always. Signed-off-by: Logan Gunthorpe --- test | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/test b/test index da6db5e0f631..61d9ee83226e 100755 --- a/test +++ b/test @@ -10,6 +10,8 @@ devlist= savelogs=0 exitonerror=1 +ctrl_c_error=0 +skipbroken=0 loop=1 prefix='[0-9][0-9]' @@ -36,6 +38,7 @@ die() { ctrl_c() { exitonerror=1 + ctrl_c_error=1 } # mdadm always adds --quiet, and we want to see any unexpected messages @@ -80,8 +83,21 @@ mdadm() { do_test() { _script=$1 _basename=`basename $_script` + _broken=0 + if [ -f "$_script" ] then + if [ -f "${_script}.broken" ]; then + _broken=1 + _broken_msg=$(head -n1 "${_script}.broken" | tr -d '\n') + if [ "$skipbroken" == "all" ]; then + return + elif [ "$skipbroken" == "always" ] && + [[ "$_broken_msg" == *always* ]]; then + return + fi + fi + rm -f $targetdir/stderr # this might have been reset: restore the default. echo 2000 > /proc/sys/dev/raid/speed_limit_max @@ -98,10 +114,15 @@ do_test() { else save_log fail _fail=1 + if [ "$_broken" == "1" ]; then + echo " (KNOWN BROKEN TEST: $_broken_msg)" + fi fi [ "$savelogs" == "1" ] && mv -f $targetdir/log $logdir/$_basename.log - [ "$_fail" == "1" -a "$exitonerror" == "1" ] && exit 1 + [ "$ctrl_c_error" == "1" ] && exit 1 + [ "$_fail" == "1" -a "$exitonerror" == "1" \ + -a "$_broken" == "0" ] && exit 1 fi } @@ -119,6 +140,8 @@ do_help() { --save-logs Usually use with --logdir together --keep-going | --no-error Don't stop on error, ie. run all tests --loop=N Run tests N times (0 to run forever) + --skip-broken Skip tests that are known to be broken + --skip-always-broken Skip tests that are known to always fail --dev=loop|lvm|ram|disk Use loop devices (default), LVM, RAM or disk --disks= Provide a bunch of physical devices for test --volgroup=name LVM volume group for LVM test @@ -216,6 +239,12 @@ parse_args() { --loop=* ) loop="${i##*=}" ;; + --skip-broken ) + skipbroken=all + ;; + --skip-always-broken ) + skipbroken=always + ;; --disable-multipath ) unset MULTIPATH ;; @@ -279,7 +308,11 @@ main() { else for script in $testdir/$prefix $testdir/$prefix*[^~] do - do_test $script + case $script in + *.broken) ;; + *) + do_test $script + esac done fi From patchwork Thu Jun 9 21:11:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 12875987 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89324C433EF for ; Thu, 9 Jun 2022 21:11:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345390AbiFIVLw (ORCPT ); Thu, 9 Jun 2022 17:11:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345362AbiFIVLo (ORCPT ); Thu, 9 Jun 2022 17:11:44 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 057FC26D364 for ; Thu, 9 Jun 2022 14:11:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:Cc:To:From:content-disposition; bh=24NPd3TXC+wArGeR4VTtezXWsAjfROmbJQ3jNpnP+s8=; b=hqHb0jQzTaXP2c6RC2Iha+w7LH 91R59N5oyO/sHdrMcdIXShmV87MlMnlB57ZcPBZ16D/usXIn0t4z5esQ/4Ye68t2w0soEXBnOTBzD uQJb74ivORdnKtI5BqI/85pceTMscEUJb+q9H6lVbHLzEsT20kztHnlqlJkEOuO7IvMgNpgKU4QmG OvCMhVe9ElphNN5/sSUkyrWIXmFrCIXBjeUpU6MlW+RoEGYy6F7raLv8rYCj355iAY6gkWEERyeXs yhh0+hpCUTc+VBss5/sRjKcPyU4pynzKej1gkx1F3pYVWUmfNZgNAdj5V9s6CBYfckqyNGNT+/rbf oSgezYpg==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nzPRK-0037Xl-Lh; Thu, 09 Jun 2022 15:11:40 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.94.2) (envelope-from ) id 1nzPRG-0001MC-4L; Thu, 09 Jun 2022 15:11:34 -0600 From: Logan Gunthorpe To: linux-raid@vger.kernel.org, Jes Sorensen Cc: Song Liu , Christoph Hellwig , Donald Buczek , Guoqing Jiang , Xiao Ni , Himanshu Madhani , Mariusz Tkaczyk , Coly Li , Bruce Dubbs , Stephen Bates , Martin Oliveira , David Sloan , Logan Gunthorpe Date: Thu, 9 Jun 2022 15:11:30 -0600 Message-Id: <20220609211130.5108-15-logang@deltatee.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220609211130.5108-1-logang@deltatee.com> References: <20220609211130.5108-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-raid@vger.kernel.org, jsorensen@fb.com, song@kernel.org, hch@infradead.org, buczek@molgen.mpg.de, guoqing.jiang@linux.dev, xni@redhat.com, himanshu.madhani@oracle.com, mariusz.tkaczyk@linux.intel.com, colyli@suse.de, bruce.dubbs@gmail.com, sbates@raithlin.com, Martin.Oliveira@eideticom.com, David.Sloan@eideticom.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com Subject: [PATCH mdadm v1 14/14] tests: Add broken files for all broken tests X-SA-Exim-Version: 4.2.1 (built Sat, 13 Feb 2021 17:57:42 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org Each broken file contains the rough frequency of brokeness as well as a brief explanation of what happens when it breaks. Estimates of failure rates are not statistically significant and can vary run to run. This is really just a view from my window. Tests were done on a small VM with the default loop devices, not real hardware. We've seen different kernel configurations can cause bugs to appear as well (ie. different block schedulers). It may also be that different race conditions will be seen on machines with different performance characteristics. These annotations were done with the kernel currently in md/md-next: facef3b96c5b ("md: Notify sysfs sync_completed in md_reap_sync_thread()") Signed-off-by: Logan Gunthorpe --- tests/01r5integ.broken | 7 ++++ tests/01raid6integ.broken | 7 ++++ tests/04r5swap.broken | 7 ++++ tests/07autoassemble.broken | 8 ++++ tests/07autodetect.broken | 5 +++ tests/07changelevelintr.broken | 9 +++++ tests/07changelevels.broken | 9 +++++ tests/07reshape5intr.broken | 45 ++++++++++++++++++++++ tests/07revert-grow.broken | 31 +++++++++++++++ tests/07revert-shrink.broken | 9 +++++ tests/07testreshape5.broken | 12 ++++++ tests/09imsm-assemble.broken | 6 +++ tests/09imsm-create-fail-rebuild.broken | 5 +++ tests/09imsm-overlap.broken | 7 ++++ tests/10ddf-assemble-missing.broken | 6 +++ tests/10ddf-fail-create-race.broken | 7 ++++ tests/10ddf-fail-two-spares.broken | 5 +++ tests/10ddf-incremental-wrong-order.broken | 9 +++++ tests/14imsm-r1_2d-grow-r1_3d.broken | 5 +++ tests/14imsm-r1_2d-takeover-r0_2d.broken | 6 +++ tests/18imsm-r10_4d-takeover-r0_2d.broken | 5 +++ tests/18imsm-r1_2d-takeover-r0_1d.broken | 6 +++ tests/19raid6auto-repair.broken | 5 +++ tests/19raid6repair.broken | 5 +++ 24 files changed, 226 insertions(+) create mode 100644 tests/01r5integ.broken create mode 100644 tests/01raid6integ.broken create mode 100644 tests/04r5swap.broken create mode 100644 tests/07autoassemble.broken create mode 100644 tests/07autodetect.broken create mode 100644 tests/07changelevelintr.broken create mode 100644 tests/07changelevels.broken create mode 100644 tests/07reshape5intr.broken create mode 100644 tests/07revert-grow.broken create mode 100644 tests/07revert-shrink.broken create mode 100644 tests/07testreshape5.broken create mode 100644 tests/09imsm-assemble.broken create mode 100644 tests/09imsm-create-fail-rebuild.broken create mode 100644 tests/09imsm-overlap.broken create mode 100644 tests/10ddf-assemble-missing.broken create mode 100644 tests/10ddf-fail-create-race.broken create mode 100644 tests/10ddf-fail-two-spares.broken create mode 100644 tests/10ddf-incremental-wrong-order.broken create mode 100644 tests/14imsm-r1_2d-grow-r1_3d.broken create mode 100644 tests/14imsm-r1_2d-takeover-r0_2d.broken create mode 100644 tests/18imsm-r10_4d-takeover-r0_2d.broken create mode 100644 tests/18imsm-r1_2d-takeover-r0_1d.broken create mode 100644 tests/19raid6auto-repair.broken create mode 100644 tests/19raid6repair.broken diff --git a/tests/01r5integ.broken b/tests/01r5integ.broken new file mode 100644 index 000000000000..207376372243 --- /dev/null +++ b/tests/01r5integ.broken @@ -0,0 +1,7 @@ +fails rarely + +Fails about 1 in every 30 runs with a sha mismatch error: + + c49ab26e1b01def7874af9b8a6d6d0c29fdfafe6 /dev/md0 does not match + 15dc2f73262f811ada53c65e505ceec9cf025cb9 /dev/md0 with /dev/loop3 + missing diff --git a/tests/01raid6integ.broken b/tests/01raid6integ.broken new file mode 100644 index 000000000000..1df735f08c8c --- /dev/null +++ b/tests/01raid6integ.broken @@ -0,0 +1,7 @@ +fails infrequently + +Fails about 1 in 5 with a sha mismatch: + + 8286c2bc045ae2cfe9f8b7ae3a898fa25db6926f /dev/md0 does not match + a083a0738b58caab37fd568b91b177035ded37df /dev/md0 with /dev/loop2 and + /dev/loop3 missing diff --git a/tests/04r5swap.broken b/tests/04r5swap.broken new file mode 100644 index 000000000000..e38987dbf01b --- /dev/null +++ b/tests/04r5swap.broken @@ -0,0 +1,7 @@ +always fails + +Fails with errors: + + mdadm: /dev/loop0 has no superblock - assembly aborted + + ERROR: no recovery happening diff --git a/tests/07autoassemble.broken b/tests/07autoassemble.broken new file mode 100644 index 000000000000..8be09407f628 --- /dev/null +++ b/tests/07autoassemble.broken @@ -0,0 +1,8 @@ +always fails + +Prints lots of messages, but the array doesn't assemble. Error +possibly related to: + + mdadm: /dev/md/1 is busy - skipping + mdadm: no recogniseable superblock on /dev/md/testing:0 + mdadm: /dev/md/2 is busy - skipping diff --git a/tests/07autodetect.broken b/tests/07autodetect.broken new file mode 100644 index 000000000000..294954a1f50a --- /dev/null +++ b/tests/07autodetect.broken @@ -0,0 +1,5 @@ +always fails + +Fails with error: + + ERROR: no resync happening diff --git a/tests/07changelevelintr.broken b/tests/07changelevelintr.broken new file mode 100644 index 000000000000..284b49068295 --- /dev/null +++ b/tests/07changelevelintr.broken @@ -0,0 +1,9 @@ +always fails + +Fails with errors: + + mdadm: this change will reduce the size of the array. + use --grow --array-size first to truncate array. + e.g. mdadm --grow /dev/md0 --array-size 56832 + + ERROR: no reshape happening diff --git a/tests/07changelevels.broken b/tests/07changelevels.broken new file mode 100644 index 000000000000..9b930d932c48 --- /dev/null +++ b/tests/07changelevels.broken @@ -0,0 +1,9 @@ +always fails + +Fails with errors: + + mdadm: /dev/loop0 is smaller than given size. 18976K < 19968K + metadata + mdadm: /dev/loop1 is smaller than given size. 18976K < 19968K + metadata + mdadm: /dev/loop2 is smaller than given size. 18976K < 19968K + metadata + + ERROR: /dev/md0 isn't a block device. diff --git a/tests/07reshape5intr.broken b/tests/07reshape5intr.broken new file mode 100644 index 000000000000..efe52a667172 --- /dev/null +++ b/tests/07reshape5intr.broken @@ -0,0 +1,45 @@ +always fails + +This patch, recently added to md-next causes the test to always fail: + +7e6ba434cc60 ("md: don't unregister sync_thread with reconfig_mutex +held") + +The new error is simply: + + ERROR: no reshape happening + +Before the patch, the error seen is below. + +-- + +fails infrequently + +Fails roughly 1 in 4 runs with errors: + + mdadm: Merging with already-assembled /dev/md/0 + mdadm: cannot re-read metadata from /dev/loop6 - aborting + + ERROR: no reshape happening + +Also have seen a random deadlock: + + INFO: task mdadm:109702 blocked for more than 30 seconds. + Not tainted 5.18.0-rc3-eid-vmlocalyes-dbg-00095-g3c2b5427979d #2040 + "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. + task:mdadm state:D stack: 0 pid:109702 ppid: 1 flags:0x00004000 + Call Trace: + + __schedule+0x67e/0x13b0 + schedule+0x82/0x110 + mddev_suspend+0x2e1/0x330 + suspend_lo_store+0xbd/0x140 + md_attr_store+0xcb/0x130 + sysfs_kf_write+0x89/0xb0 + kernfs_fop_write_iter+0x202/0x2c0 + new_sync_write+0x222/0x330 + vfs_write+0x3bc/0x4d0 + ksys_write+0xd9/0x180 + __x64_sys_write+0x43/0x50 + do_syscall_64+0x3b/0x90 + entry_SYSCALL_64_after_hwframe+0x44/0xae diff --git a/tests/07revert-grow.broken b/tests/07revert-grow.broken new file mode 100644 index 000000000000..9b6db86f60ab --- /dev/null +++ b/tests/07revert-grow.broken @@ -0,0 +1,31 @@ +always fails + +This patch, recently added to md-next causes the test to always fail: + +7e6ba434cc60 ("md: don't unregister sync_thread with reconfig_mutex held") + +The errors are: + + mdadm: No active reshape to revert on /dev/loop0 + ERROR: active raid5 not found + +Before the patch, the error seen is below. + +-- + +fails rarely + +Fails about 1 in every 30 runs with errors: + + mdadm: Merging with already-assembled /dev/md/0 + mdadm: backup file /tmp/md-backup inaccessible: No such file or directory + mdadm: failed to add /dev/loop1 to /dev/md/0: Invalid argument + mdadm: failed to add /dev/loop2 to /dev/md/0: Invalid argument + mdadm: failed to add /dev/loop3 to /dev/md/0: Invalid argument + mdadm: failed to add /dev/loop0 to /dev/md/0: Invalid argument + mdadm: /dev/md/0 assembled from 1 drive - need all 5 to start it + (use --run to insist). + + grep: /sys/block/md*/md/sync_action: No such file or directory + + ERROR: active raid5 not found diff --git a/tests/07revert-shrink.broken b/tests/07revert-shrink.broken new file mode 100644 index 000000000000..c33c39ec04f8 --- /dev/null +++ b/tests/07revert-shrink.broken @@ -0,0 +1,9 @@ +always fails + +Fails with errors: + + mdadm: this change will reduce the size of the array. + use --grow --array-size first to truncate array. + e.g. mdadm --grow /dev/md0 --array-size 53760 + + ERROR: active raid5 not found diff --git a/tests/07testreshape5.broken b/tests/07testreshape5.broken new file mode 100644 index 000000000000..a8ce03e491b3 --- /dev/null +++ b/tests/07testreshape5.broken @@ -0,0 +1,12 @@ +always fails + +Test seems to run 'test_stripe' at $dir directory, but $dir is never +set. If $dir is adjusted to $PWD, the test still fails with: + + mdadm: /dev/loop2 is not suitable for this array. + mdadm: create aborted + ++ return 1 + ++ cmp -s -n 8192 /dev/md0 /tmp/RandFile + ++ echo cmp failed + cmp failed + ++ exit 2 diff --git a/tests/09imsm-assemble.broken b/tests/09imsm-assemble.broken new file mode 100644 index 000000000000..a6d4d5cf911b --- /dev/null +++ b/tests/09imsm-assemble.broken @@ -0,0 +1,6 @@ +fails infrequently + +Fails roughly 1 in 10 runs with errors: + + mdadm: /dev/loop2 is still in use, cannot remove. + /dev/loop2 removal from /dev/md/container should have succeeded diff --git a/tests/09imsm-create-fail-rebuild.broken b/tests/09imsm-create-fail-rebuild.broken new file mode 100644 index 000000000000..40c4b294da38 --- /dev/null +++ b/tests/09imsm-create-fail-rebuild.broken @@ -0,0 +1,5 @@ +always fails + +Fails with error: + + **Error**: Array size mismatch - expected 3072, actual 16384 diff --git a/tests/09imsm-overlap.broken b/tests/09imsm-overlap.broken new file mode 100644 index 000000000000..e7ccab768bea --- /dev/null +++ b/tests/09imsm-overlap.broken @@ -0,0 +1,7 @@ +always fails + +Fails with errors: + + **Error**: Offset mismatch - expected 15360, actual 0 + **Error**: Offset mismatch - expected 15360, actual 0 + /dev/md/vol3 failed check diff --git a/tests/10ddf-assemble-missing.broken b/tests/10ddf-assemble-missing.broken new file mode 100644 index 000000000000..bfd8d103a630 --- /dev/null +++ b/tests/10ddf-assemble-missing.broken @@ -0,0 +1,6 @@ +always fails + +Fails with errors: + + ERROR: /dev/md/vol0 has unexpected state on /dev/loop10 + ERROR: unexpected number of online disks on /dev/loop10 diff --git a/tests/10ddf-fail-create-race.broken b/tests/10ddf-fail-create-race.broken new file mode 100644 index 000000000000..6c0df023fb18 --- /dev/null +++ b/tests/10ddf-fail-create-race.broken @@ -0,0 +1,7 @@ +usually fails + +Fails about 9 out of 10 times with many errors: + + mdadm: cannot open MISSING: No such file or directory + ERROR: non-degraded array found + ERROR: disk 0 not marked as failed in meta data diff --git a/tests/10ddf-fail-two-spares.broken b/tests/10ddf-fail-two-spares.broken new file mode 100644 index 000000000000..eeea56d989ff --- /dev/null +++ b/tests/10ddf-fail-two-spares.broken @@ -0,0 +1,5 @@ +fails infrequently + +Fails roughly 1 in 3 with error: + + ERROR: /dev/md/vol1 should be optimal in meta data diff --git a/tests/10ddf-incremental-wrong-order.broken b/tests/10ddf-incremental-wrong-order.broken new file mode 100644 index 000000000000..a5af3bab2ec2 --- /dev/null +++ b/tests/10ddf-incremental-wrong-order.broken @@ -0,0 +1,9 @@ +always fails + +Fails with errors: + ERROR: sha1sum of /dev/md/vol0 has changed + ERROR: /dev/md/vol0 has unexpected state on /dev/loop10 + ERROR: unexpected number of online disks on /dev/loop10 + ERROR: /dev/md/vol0 has unexpected state on /dev/loop8 + ERROR: unexpected number of online disks on /dev/loop8 + ERROR: sha1sum of /dev/md/vol0 has changed diff --git a/tests/14imsm-r1_2d-grow-r1_3d.broken b/tests/14imsm-r1_2d-grow-r1_3d.broken new file mode 100644 index 000000000000..4ef1d4069b65 --- /dev/null +++ b/tests/14imsm-r1_2d-grow-r1_3d.broken @@ -0,0 +1,5 @@ +always fails + +Fails with error: + + mdadm/tests/func.sh: line 325: dvsize/chunk: division by 0 (error token is "chunk") diff --git a/tests/14imsm-r1_2d-takeover-r0_2d.broken b/tests/14imsm-r1_2d-takeover-r0_2d.broken new file mode 100644 index 000000000000..89cd4e575362 --- /dev/null +++ b/tests/14imsm-r1_2d-takeover-r0_2d.broken @@ -0,0 +1,6 @@ +always fails + +Fails with error: + + tests/func.sh: line 325: dvsize/chunk: division by 0 (error token + is "chunk") diff --git a/tests/18imsm-r10_4d-takeover-r0_2d.broken b/tests/18imsm-r10_4d-takeover-r0_2d.broken new file mode 100644 index 000000000000..a27399f5ed83 --- /dev/null +++ b/tests/18imsm-r10_4d-takeover-r0_2d.broken @@ -0,0 +1,5 @@ +fails rarely + +Fails about 1 run in 100 with message: + + ERROR: size is wrong for /dev/md/vol0: 2 * 5120 (chunk=128) = 20480, not 0 diff --git a/tests/18imsm-r1_2d-takeover-r0_1d.broken b/tests/18imsm-r1_2d-takeover-r0_1d.broken new file mode 100644 index 000000000000..59aadfa1ef0e --- /dev/null +++ b/tests/18imsm-r1_2d-takeover-r0_1d.broken @@ -0,0 +1,6 @@ +always fails + +Fails with error: + + tests/func.sh: line 325: dvsize/chunk: division by 0 (error token + is "chunk") diff --git a/tests/19raid6auto-repair.broken b/tests/19raid6auto-repair.broken new file mode 100644 index 000000000000..e91a142575e2 --- /dev/null +++ b/tests/19raid6auto-repair.broken @@ -0,0 +1,5 @@ +always fails + +Fails with: + + "should detect errors" diff --git a/tests/19raid6repair.broken b/tests/19raid6repair.broken new file mode 100644 index 000000000000..e91a142575e2 --- /dev/null +++ b/tests/19raid6repair.broken @@ -0,0 +1,5 @@ +always fails + +Fails with: + + "should detect errors"