From patchwork Wed May 22 08:50:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Ni X-Patchwork-Id: 13670593 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9729946522 for ; Wed, 22 May 2024 08:51:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367870; cv=none; b=UoFIaUsW+xL39e/3+o/QVD2Fmjn5gHUwbYldXPhLoM/zK3b+mDRVtxK4ix2QeO4fazL9uOpUj1NqeTos6VF5r1nxhn8BtWMzG9IpC3QI/4dqaop1jb6dbfRtHoZ+ejf6koSsJVeoBjbPKERR5ETLBd6uxF6KGHl/+zT5vdwWouM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367870; c=relaxed/simple; bh=Qcc7jICJqMRBE+LMXdOfMb7w0nRbJvUxn7pgMvEe+9A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rT0EixWctGBQ0rGAd8sB9sxXYlPoSbqDRILJ1SMvUHzP47Uq54yJO1wOqs2QehAx4KxBmy8RmcmffTP3fkHQer4p//6zXv4+0FtnpcXk+yaX+jGFvVPLPMnwic44dEeI2kc2PIovO6efXJfCAkFvjbytJCocNPGP7sV/xMNWU7s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=G802Z7hN; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="G802Z7hN" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716367867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XkTS2orXNgaZRm+RPcvf2QgflS7N1q7aEo4BAOLTF0U=; b=G802Z7hNZtsWly3GhmpvZvFCuG9cb5zLl6mLdMHLhHFvnjbKqab+HX+PPjpXMK/HvlAc2y lksoDIBj7UHutJcl/TUYyeYWAMAUxYeB2UOm3wqtqI3IDSu/Bhc2Ve3yQ9BkBmEi6bRXDx b6WYGgh0LFxbSmXR4m4zWmm1+UgjHSQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-31-8VCWnn4lMJW7MiGnq1xcGw-1; Wed, 22 May 2024 04:51:04 -0400 X-MC-Unique: 8VCWnn4lMJW7MiGnq1xcGw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0FD2E812296; Wed, 22 May 2024 08:51:04 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id E8BF2C15BB1; Wed, 22 May 2024 08:51:01 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: linux-raid@vger.kernel.org, heinzm@redhat.com, ncroxon@redhat.com Subject: [PATCH 01/19] Change some error messages to info level Date: Wed, 22 May 2024 16:50:38 +0800 Message-Id: <20240522085056.54818-2-xni@redhat.com> In-Reply-To: <20240522085056.54818-1-xni@redhat.com> References: <20240522085056.54818-1-xni@redhat.com> Precedence: bulk X-Mailing-List: linux-raid@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 These logs are not error logs. Change them to info level. Signed-off-by: Xiao Ni --- Assemble.c | 16 ++++++---------- Manage.c | 2 +- util.c | 4 ++-- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Assemble.c b/Assemble.c index 83dced19ceba..65cdb737382a 100644 --- a/Assemble.c +++ b/Assemble.c @@ -1209,23 +1209,19 @@ static int start_array(int mdfd, if (rv == 0) { sysfs_rules_apply(mddev, content); if (c->verbose >= 0) { - pr_err("%s has been started with %d drive%s", + pr_info("%s has been started with %d drive%s", mddev, okcnt, okcnt==1?"":"s"); if (okcnt < (unsigned)content->array.raid_disks) - fprintf(stderr, " (out of %d)", - content->array.raid_disks); + printf(" (out of %d)", content->array.raid_disks); if (rebuilding_cnt) - fprintf(stderr, "%s %d rebuilding", - sparecnt?",":" and", + printf("%s %d rebuilding", sparecnt?",":" and", rebuilding_cnt); if (sparecnt) - fprintf(stderr, " and %d spare%s", - sparecnt, + printf(" and %d spare%s", sparecnt, sparecnt == 1 ? "" : "s"); if (content->journal_clean) - fprintf(stderr, " and %d journal", - journalcnt); - fprintf(stderr, ".\n"); + printf(" and %d journal", journalcnt); + printf(".\n"); } if (content->reshape_active && is_level456(content->array.level)) { diff --git a/Manage.c b/Manage.c index 96e5ee5427a2..5db72b778fbe 100644 --- a/Manage.c +++ b/Manage.c @@ -463,7 +463,7 @@ done: } if (verbose >= 0) - pr_err("stopped %s\n", devname); + pr_info("stopped %s\n", devname); map_lock(&map); map_remove(&map, devnm); map_unlock(&map); diff --git a/util.c b/util.c index bf79742fe44e..48c97545a42a 100644 --- a/util.c +++ b/util.c @@ -633,9 +633,9 @@ int check_ext2(int fd, char *name) bsize = sb[24]|(sb[25]|(sb[26]|sb[27]<<8)<<8)<<8; size = sb[4]|(sb[5]|(sb[6]|sb[7]<<8)<<8)<<8; size <<= bsize; - pr_err("%s appears to contain an ext2fs file system\n", + pr_info("%s appears to contain an ext2fs file system\n", name); - cont_err("size=%lluK mtime=%s", size, ctime(&mtime)); + pr_info("size=%lluK mtime=%s", size, ctime(&mtime)); return 1; } From patchwork Wed May 22 08:50:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Ni X-Patchwork-Id: 13670594 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CEF0146522 for ; Wed, 22 May 2024 08:51:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367873; cv=none; b=i+U53IAbNokwoPCCN9HwJrPl5WUx577h1yFW6meFxT0XIpAo8k9alkltbcwrZPylB9MtDFrUvlQ8pImCNimENbD1X02BzH6RiE7Y6mrXmkH87Oh5Iq8beI4vPGzGpCFXKYdeAO25HdOM/VD+Cl3sQSHQ+uI2s2GzXqBvHLidXKM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367873; c=relaxed/simple; bh=UdmxJeD7p7Iz2pDyLe4hgVviElEn734ea31JcG22st8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KRtRyiaF7mOHF9nodnaqiuevvyc7i4bcycPfz8L0SusJZgDptYOktt2HjT6DdgNwYhppSTMDRQP7332lmsqfJ6/fNEqk10WHtks8f/cQbuDSaZMUJKgJazKlJXUIqF3DTnn3fsZpge3rgC+6gMVIcJQmI+mSYwKTHeVwz5tSUbc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=F6K3I/jL; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="F6K3I/jL" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716367870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wZwkwGf3fwN2OJAiGwy3qOAyN1yPeTZeQUdex8FfuL0=; b=F6K3I/jLQksdLUEyxR79Kbn5Gr/I/wxqu73rlAsEldqcabfZHREaL/qjQqBm6hyjd9aAeN 15Fmoz1+kDFwB/q4e2lB+0l173np+aJxCm0CfcI6iGwf23GlYGOb8sdqYT4cXbr7oDjzDq MGNW2r5YQNaglhzyjkNksmtvWY9ldTI= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-149-a6e3G-mEPmCqMVZ4gjSGtw-1; Wed, 22 May 2024 04:51:07 -0400 X-MC-Unique: a6e3G-mEPmCqMVZ4gjSGtw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C81513800089; Wed, 22 May 2024 08:51:06 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id B26A7C15BB1; Wed, 22 May 2024 08:51:04 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: linux-raid@vger.kernel.org, heinzm@redhat.com, ncroxon@redhat.com Subject: [PATCH 02/19] mdadm: Start update_opt from 0 Date: Wed, 22 May 2024 16:50:39 +0800 Message-Id: <20240522085056.54818-3-xni@redhat.com> In-Reply-To: <20240522085056.54818-1-xni@redhat.com> References: <20240522085056.54818-1-xni@redhat.com> Precedence: bulk X-Mailing-List: linux-raid@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 Before f2e8393bd722 ('Manage&Incremental: code refactor, string to enum'), it uses NULL to represent it doesn't need to update. So init UOPT_UNDEFINED to 0. This problem is found by test case 05r6tor0. Signed-off-by: Xiao Ni --- mdadm.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mdadm.h b/mdadm.h index b71d7b32ee07..40818941bb16 100644 --- a/mdadm.h +++ b/mdadm.h @@ -535,7 +535,8 @@ enum special_options { }; enum update_opt { - UOPT_NAME = 1, + UOPT_UNDEFINED = 0, + UOPT_NAME, UOPT_PPL, UOPT_NO_PPL, UOPT_BITMAP, @@ -575,7 +576,6 @@ enum update_opt { UOPT_SPEC_FAILFAST, UOPT_SPEC_NOFAILFAST, UOPT_SPEC_REVERT_RESHAPE_NOBACKUP, - UOPT_UNDEFINED }; extern void fprint_update_options(FILE *outf, enum update_opt update_mode); From patchwork Wed May 22 08:50:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Ni X-Patchwork-Id: 13670595 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5699E7710B for ; Wed, 22 May 2024 08:51:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367875; cv=none; b=nrr02i2P0K8WCLktuepSlxnjl1Oaam4Zh6BY6A5Qsn3KYYIxUjPlTLhctBJD6xtfw+K9ccjFoi1d48UPxDfyXjheE2SF52f8sl+eXRseLfKIVvr48M6U3PS18X+RmfMB/j0/7+0ZhlT8KY3cQUoSlPV2LF6+zICtUhX9IwYYGHk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367875; c=relaxed/simple; bh=p+QZAwKCqkCkvWFiz3xHlQ+LJqcMBgExQb7mKMWDfGg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=H111unkpI0zd+RNGWUluiAIBAFNo3cffHlZs8GpA21MdpdJY9mClAb3G5Qr3W9saz7NWZQ52GU0eG7QyXV1lheqljnx9s94Cu/vDu6JkS3LHA7U0wCFJsq6XRP9aCmiluXOKkrsUtsp8wyAuIclPfRd7ZKdh9VDI6xINHi6Y6S8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=GjhKUjrj; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="GjhKUjrj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716367873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zY9hqlO8AHvdci9zGdscxG2InfC1+6VqbfudXccxZjw=; b=GjhKUjrj/SfMUWnFKX7imjuz9AtiYBnP/GRs6bM8Lan42qr5A96MnZyDKp7/QGL187O46H JWexqfH20F6XVaQbZgfSrJ/bYyKIkXp6IrUtgwNq45kx+kBhZOe9It8TCoP4VAEQDUpSge oBubTc//5KeOay+Vnfk2sySrJ1AAWEc= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-70-oAbOAfY7PaqSYETpEhY0dQ-1; Wed, 22 May 2024 04:51:10 -0400 X-MC-Unique: oAbOAfY7PaqSYETpEhY0dQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C80D3380673C; Wed, 22 May 2024 08:51:09 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8F3DFC15BB1; Wed, 22 May 2024 08:51:07 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: linux-raid@vger.kernel.org, heinzm@redhat.com, ncroxon@redhat.com Subject: [PATCH 03/19] Don't control reshape speed in daemon Date: Wed, 22 May 2024 16:50:40 +0800 Message-Id: <20240522085056.54818-4-xni@redhat.com> In-Reply-To: <20240522085056.54818-1-xni@redhat.com> References: <20240522085056.54818-1-xni@redhat.com> Precedence: bulk X-Mailing-List: linux-raid@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 It tries to set the max sync speed in reshape. This should be done by administrators by control interfaces /proc/sys/dev/raid/speed_limit_max/min. Signed-off-by: Xiao Ni --- Grow.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Grow.c b/Grow.c index 1923c27c4274..01bbb338cb1b 100644 --- a/Grow.c +++ b/Grow.c @@ -4484,7 +4484,6 @@ int child_monitor(int afd, struct mdinfo *sra, struct reshape *reshape, */ char *buf; int degraded = -1; - unsigned long long speed; unsigned long long suspend_point, array_size; unsigned long long backup_point, wait_point; unsigned long long reshape_completed; @@ -4540,10 +4539,6 @@ int child_monitor(int afd, struct mdinfo *sra, struct reshape *reshape, if (posix_memalign((void**)&buf, 4096, disks * chunk)) /* Don't start the 'reshape' */ return 0; - if (reshape->before.data_disks == reshape->after.data_disks) { - sysfs_get_ll(sra, NULL, "sync_speed_min", &speed); - sysfs_set_num(sra, NULL, "sync_speed_min", 200000); - } if (increasing) { array_size = sra->component_size * reshape->after.data_disks; @@ -4676,8 +4671,6 @@ int child_monitor(int afd, struct mdinfo *sra, struct reshape *reshape, sysfs_set_num(sra, NULL, "suspend_lo", 0); sysfs_set_num(sra, NULL, "sync_min", 0); - if (reshape->before.data_disks == reshape->after.data_disks) - sysfs_set_num(sra, NULL, "sync_speed_min", speed); free(buf); return done; } From patchwork Wed May 22 08:50:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Ni X-Patchwork-Id: 13670597 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3693280046 for ; Wed, 22 May 2024 08:51:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367878; cv=none; b=rp6aIMJ+7V2BVMKYs0FBFXODpticVgHKK2dtBfwCtwYCuiG/jnKMW5dbQDJ7zm7KL8fj3oZyhMQnmTzp84qYt1HUHKJhvm9qSPZHEw6o9oAq+UfH27rh7mu9iXEi53uwn2ypaV+8DUTG5+r/Q2M38hmOypP2XlAHpvaWCvZgFzk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367878; c=relaxed/simple; bh=xDLS+HBobZvI8Bp/xZO4MkJIxKrJhHK4/jvyx0IY+Gs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UIoskqW8/rXDCSLfePFf1+DIYLlV2em3+osPK+MmiDGTCuAIJNxDwVIP15XeuV/MpmnNAZ/t//Lgr85gzBVwML9cIhVXRD3nTFXCOIPWNS0gz6ltfaPaVjVfxNCPvklp+ghnCuUjoYCfAFwEYwaKW3vGz3sDDw3dlUUOzq+BOF0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Mx/ohwb9; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Mx/ohwb9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716367876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xY+deuSavt7Rx4yM5VbroGZv149KQlWRNm9KNcUloWc=; b=Mx/ohwb9j879DhoBRxRpp/poWZmkGgB8XMKoZGabzUuy1ZVd0AxYmvJ7oeQV15iV4BMwfJ sFRJYnI2ZwAURyMXEK1iZExjPP9f/GH1LQMg35WMwJw4moDuCC8Xril5Fym7uRIMKFb1kg R1tUv43tgvU9FKn/5A+PW6gyYN7++Sk= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-425-xUpVVvYkPD6kYfIVrhLUOA-1; Wed, 22 May 2024 04:51:13 -0400 X-MC-Unique: xUpVVvYkPD6kYfIVrhLUOA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A04E81C29EA1; Wed, 22 May 2024 08:51:12 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 767AAC15BB1; Wed, 22 May 2024 08:51:10 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: linux-raid@vger.kernel.org, heinzm@redhat.com, ncroxon@redhat.com Subject: [PATCH 04/19] mdadm/tests: test enhance Date: Wed, 22 May 2024 16:50:41 +0800 Message-Id: <20240522085056.54818-5-xni@redhat.com> In-Reply-To: <20240522085056.54818-1-xni@redhat.com> References: <20240522085056.54818-1-xni@redhat.com> Precedence: bulk X-Mailing-List: linux-raid@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 There are two changes. First, if md module is not loaded, it gives error when reading speed_limit_max. So read the value after loading md module which is done in do_setup Second, sometimes the test reports error sync action doesn't happen. But dmesg shows sync action is done. So limit the sync speed before test. It doesn't affect the test run time. Because check wait sets the max speed before waiting sync action. And recording speed_limit_max/min in do_setup. Fixes: 4c12714d1ca0 ('test: run tests on system level mdadm') Signed-off-by: Xiao Ni --- test | 10 +++++----- tests/func.sh | 26 +++++++++++++++++++++++--- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/test b/test index 338c2db44fa7..ff403293d60b 100755 --- a/test +++ b/test @@ -6,7 +6,10 @@ targetdir="/var/tmp" logdir="$targetdir" config=/tmp/mdadm.conf testdir=$PWD/tests -system_speed_limit=`cat /proc/sys/dev/raid/speed_limit_max` +system_speed_limit_max=0 +system_speed_limit_min=0 +test_speed_limit_min=100 +test_speed_limit_max=500 devlist= savelogs=0 @@ -39,10 +42,6 @@ ctrl_c() { ctrl_c_error=1 } -restore_system_speed_limit() { - echo $system_speed_limit > /proc/sys/dev/raid/speed_limit_max -} - mdadm() { rm -f $targetdir/stderr case $* in @@ -103,6 +102,7 @@ do_test() { do_clean # source script in a subshell, so it has access to our # namespace, but cannot change it. + control_system_speed_limit echo -ne "$_script... " if ( set -ex ; . $_script ) &> $targetdir/log then diff --git a/tests/func.sh b/tests/func.sh index b474442b6abe..221cff158f8c 100644 --- a/tests/func.sh +++ b/tests/func.sh @@ -136,6 +136,23 @@ check_env() { fi } +record_system_speed_limit() { + system_speed_limit_max=`cat /proc/sys/dev/raid/speed_limit_max` + system_speed_limit_min=`cat /proc/sys/dev/raid/speed_limit_min` +} + +# To avoid sync action finishes before checking it, it needs to limit +# the sync speed +control_system_speed_limit() { + echo $test_speed_limit_min > /proc/sys/dev/raid/speed_limit_min + echo $test_speed_limit_max > /proc/sys/dev/raid/speed_limit_max +} + +restore_system_speed_limit() { + echo $system_speed_limit_min > /proc/sys/dev/raid/speed_limit_max + echo $system_speed_limit_max > /proc/sys/dev/raid/speed_limit_max +} + do_setup() { trap cleanup 0 1 3 15 trap ctrl_c 2 @@ -214,6 +231,7 @@ do_setup() { ulimit -c unlimited [ -f /proc/mdstat ] || modprobe md_mod echo 0 > /sys/module/md_mod/parameters/start_ro + record_system_speed_limit } # check various things @@ -265,15 +283,17 @@ check() { fi ;; wait ) - p=`cat /proc/sys/dev/raid/speed_limit_max` - echo 2000000 > /proc/sys/dev/raid/speed_limit_max + min=`cat /proc/sys/dev/raid/speed_limit_min` + max=`cat /proc/sys/dev/raid/speed_limit_max` + echo 200000 > /proc/sys/dev/raid/speed_limit_max sleep 0.1 while grep -Eq '(resync|recovery|reshape|check|repair) *=' /proc/mdstat || grep -v idle > /dev/null /sys/block/md*/md/sync_action do sleep 0.5 done - echo $p > /proc/sys/dev/raid/speed_limit_max + echo $min > /proc/sys/dev/raid/speed_limit_min + echo $max > /proc/sys/dev/raid/speed_limit_max ;; state ) grep -sq "blocks.*\[$2\]\$" /proc/mdstat || From patchwork Wed May 22 08:50:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Ni X-Patchwork-Id: 13670598 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E98097F486 for ; Wed, 22 May 2024 08:51:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367879; cv=none; b=gyUQYPB128cLoqOQxB5exZ9rXOLno6CCqJZF/5gTS9MC5ju4oZvBXM6rq8RcylX4xd9uNPG6yPfMDlm3hVKSqlQsCwZOU96R+VajGYfuM2ioUOHxCAsrc33evYKVrXc8KtCs0s/OqpipAOSl3EVuU1XRqzH3NGb8x75WZ5biZ8Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367879; c=relaxed/simple; bh=mpV+FUYQDamOUAqmuTpFFOI5DYVWGMxFSHTKzYtqqyM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tAxnoqB/bn9/2x3UTEM5vZzyrCvNhCBV8w9Vr01MDK4uQnPHJhk3UpRnTzNgHysmJKOn7R+q01ztkb6/zykbrAZESLaZi+qzrNjBElw9Qd6SrYIiB2zLfxFy59UobG/dKRamoyDv1BBQIoY4UnhR3EjJkUFo4sVZCdGNPvDoSLo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=jWcd0rEO; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="jWcd0rEO" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716367876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4acbDdOAxd10ZWCSOH++imn4YKmDBzD73Trmf+POX2w=; b=jWcd0rEOzQksRj4wsSk++cSSRPfiqA0IGC9T7TU1qK8Cegjt5n5AlWby0aE8zmtlclA4Ah otWRKpUAmpm59i4wfiHM7uOAOvxyvjxW3n/o1s57HD5BmdKwbtd6z54lZWvAE5bt3fYiQ1 zMwwlLuQ8a1AT4Gx5ZNpjuBY9BOvUAY= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-422-HXeRoEwDM8-B-9Zq6pTCbA-1; Wed, 22 May 2024 04:51:15 -0400 X-MC-Unique: HXeRoEwDM8-B-9Zq6pTCbA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 82D7629AA3AD; Wed, 22 May 2024 08:51:15 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 687C8C15BB9; Wed, 22 May 2024 08:51:13 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: linux-raid@vger.kernel.org, heinzm@redhat.com, ncroxon@redhat.com Subject: [PATCH 05/19] mdadm/tests: test don't fail when systemd reports error Date: Wed, 22 May 2024 16:50:42 +0800 Message-Id: <20240522085056.54818-6-xni@redhat.com> In-Reply-To: <20240522085056.54818-1-xni@redhat.com> References: <20240522085056.54818-1-xni@redhat.com> Precedence: bulk X-Mailing-List: linux-raid@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 Sometimes systemd reports error in dmesg and test fails. Add a condition to avoid this failure. Signed-off-by: Xiao Ni --- test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test b/test index ff403293d60b..3da53f871122 100755 --- a/test +++ b/test @@ -109,7 +109,7 @@ do_test() { if [ -f "${_script}.inject_error" ]; then echo "dmesg checking is skipped because test inject error" else - dmesg | grep -iq "error\|call trace\|segfault" && + dmesg | grep -iq "error\|call trace\|segfault" | grep -v "systemd" && die "dmesg prints errors when testing $_basename!" fi echo "succeeded" From patchwork Wed May 22 08:50:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Ni X-Patchwork-Id: 13670599 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3010580628 for ; Wed, 22 May 2024 08:51:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367882; cv=none; b=Muh2XCOI9jixgzOowlWzXX2KsA6xJlIDjsAd1ebAQ+9VrQHoVYhFTZgo/+rlUd0hc8jdoZunjq3CYfwBdxjEDkvyHDYF4Lhtv2T8m8/jTDihMs1mR9+5S7P/g/Omw4xUstEPX9tyqSTc077HzV1aJR3TyC8zbqoGY6WLU1O3Jcs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367882; c=relaxed/simple; bh=Zt9kZZje5RvDpp1t3Ang0h0IfxQHSgezXSLuGtpvGjw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PBn5e1hILuKyuZGjhUeJZwHconPh5k6fFkF1O+Tk5nF5c4//h4P/X3H6VSRRwPpwiDigjOnYtc2VZ0c5wxxaWx7IiYKC0mYTG+Bn/po6Ojh+RRlL9GutqmeF+fpnGma4/1eFPP1s/CkaqernvVpxYE42XEztHO3vvtca9sDZgnk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=ZGWcIJaj; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ZGWcIJaj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716367880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YEHAuPusEdx7cCLdFiApOE3Y4WyLKL0xNXnyajxT2Uo=; b=ZGWcIJaj9g5XpROWjZGmYXILUsxLJxusDgsa6i5FMMjzW4gh+BdoVYhjNhllHz8+zPeldC Hl40/df8aDAYDa9aiUHZcdNJPhHibtEzFeYpru+Tq9DzBAQWCU2dZ9bqHKACy543JBUn4r hXe/TsczZzt2mUjw0swaKr3HlAAf+lw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-315-DwmhbsZgMh6iMMze3kBg2w-1; Wed, 22 May 2024 04:51:18 -0400 X-MC-Unique: DwmhbsZgMh6iMMze3kBg2w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6EADA81227E; Wed, 22 May 2024 08:51:18 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37E5DC15BB9; Wed, 22 May 2024 08:51:15 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: linux-raid@vger.kernel.org, heinzm@redhat.com, ncroxon@redhat.com Subject: [PATCH 06/19] mdadm/tests: names_template enhance Date: Wed, 22 May 2024 16:50:43 +0800 Message-Id: <20240522085056.54818-7-xni@redhat.com> In-Reply-To: <20240522085056.54818-1-xni@redhat.com> References: <20240522085056.54818-1-xni@redhat.com> Precedence: bulk X-Mailing-List: linux-raid@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 For super1, if the length of hostname is >= 32, it doesn't add hostname in metadata name. Fix this problem by checking the length of hostname. Because other cases may use need to check this, so do the check in do_setup. And this patch adds a check if link /dev/md/name exists. Signed-off-by: Xiao Ni --- test | 5 +++++ tests/func.sh | 13 +++++++++++++ tests/templates/names_template | 14 ++++++++++++-- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/test b/test index 3da53f871122..814ce1992b0c 100755 --- a/test +++ b/test @@ -11,6 +11,11 @@ system_speed_limit_min=0 test_speed_limit_min=100 test_speed_limit_max=500 devlist= +# If super1 metadata name doesn't have the same hostname with machine, +# it's treated as foreign. +# For example, /dev/md0 is created, stops it, then assemble it, the +# device node will be /dev/md127 (127 is choosed by mdadm autumatically) +is_foreign="no" savelogs=0 exitonerror=1 diff --git a/tests/func.sh b/tests/func.sh index 221cff158f8c..cfe83e552a2a 100644 --- a/tests/func.sh +++ b/tests/func.sh @@ -153,6 +153,18 @@ restore_system_speed_limit() { echo $system_speed_limit_max > /proc/sys/dev/raid/speed_limit_max } +is_raid_foreign() { + + # If the length of hostname is >= 32, super1 doesn't use + # hostname in metadata + hostname=$(hostname) + if [ `expr length $(hostname)` -lt 32 ]; then + is_foreign="no" + else + is_foreign="yes" + fi +} + do_setup() { trap cleanup 0 1 3 15 trap ctrl_c 2 @@ -232,6 +244,7 @@ do_setup() { [ -f /proc/mdstat ] || modprobe md_mod echo 0 > /sys/module/md_mod/parameters/start_ro record_system_speed_limit + is_raid_foreign } # check various things diff --git a/tests/templates/names_template b/tests/templates/names_template index 1b6cd14bf51d..88ad5b8c6b38 100644 --- a/tests/templates/names_template +++ b/tests/templates/names_template @@ -30,6 +30,7 @@ function names_verify() { local DEVNODE_NAME="$1" local WANTED_LINK="$2" local WANTED_NAME="$3" + local EXPECTED="" local RES="$(mdadm -D --export $DEVNODE_NAME | grep MD_DEVNAME)" if [[ "$?" != "0" ]]; then @@ -38,7 +39,12 @@ function names_verify() { fi if [[ "$WANTED_LINK" != "empty" ]]; then - local EXPECTED="MD_DEVNAME=$WANTED_LINK" + EXPECTED="MD_DEVNAME=$WANTED_LINK" + + if [ ! -b /dev/md/$WANTED_LINK ]; then + echo "/dev/md/$WANTED_LINK doesn't exit" + exit 1 + fi fi if [[ "$RES" != "$EXPECTED" ]]; then @@ -52,7 +58,11 @@ function names_verify() { exit 1 fi - local EXPECTED="MD_NAME=$(hostname):$WANTED_NAME" + if [ $is_foreign == "no" ]; then + EXPECTED="MD_NAME=$(hostname):$WANTED_NAME" + else + EXPECTED="MD_NAME=$WANTED_NAME" + fi if [[ "$RES" != "$EXPECTED" ]]; then echo "$RES doesn't match $EXPECTED." exit 1 From patchwork Wed May 22 08:50:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Ni X-Patchwork-Id: 13670600 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E66A47710B for ; Wed, 22 May 2024 08:51:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367888; cv=none; b=L2/aC31BWvv5QTffdQOk/QBvJFiqfxvPKKKIhW0gjhuWVLJoDgWTRR5O6aQb6dUQTSu8ERaKDkB1OFokNRhVK3a7A7M4UTpo9n8dPK4AYfiUVezndXTvHym3jmXdIlYOyhjTeDRXpH7ntkemrHLW88mhD/ou8ipYijgW446s+vM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367888; c=relaxed/simple; bh=KyFlFKLgNaS+AutvlUnOCX2rVMyAVz6OZbDj6By0pPw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ophj7bnUnStuAaZd8DGaSKVKFcM3sPFCldj+SE6+gRjZFFIOwiviiFwKOgJL+IKiowpE7zmABaAO3ECE4P5gHLmYoVVwpPvzWhF+7ghF9uUtU/5KL70QgqL6Z3RDFZ+pYTq4ydguB104z68n2bBVaArj43irAA1wKunL3AVdx4g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=bgcPgnDy; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="bgcPgnDy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716367885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CeESm+IPkdpGhq9+Gaw3hiWNjzUOnGXM1P7XbXsUUdc=; b=bgcPgnDyuRb/DKtGeVmjut81Lc/WHb2E840a1OWjQ9SmxIiNMPbO/czWobdqVUlPAftX/D ehghTQHzybLPo8BajvkQATtGrYFbeC0bM/WaP09o03F3kPWYpFqjUINTXsvE3pz2G+LSwn t/pvAvfnNih+YW3DWjeh5w7k3G+aTPo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-695-IoWsoNHBPYa4bx0XxEjSwQ-1; Wed, 22 May 2024 04:51:21 -0400 X-MC-Unique: IoWsoNHBPYa4bx0XxEjSwQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 65C238058D1; Wed, 22 May 2024 08:51:21 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1D6F2C15BB1; Wed, 22 May 2024 08:51:18 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: linux-raid@vger.kernel.org, heinzm@redhat.com, ncroxon@redhat.com Subject: [PATCH 07/19] mdadm/tests: 03assem-incr enhance Date: Wed, 22 May 2024 16:50:44 +0800 Message-Id: <20240522085056.54818-8-xni@redhat.com> In-Reply-To: <20240522085056.54818-1-xni@redhat.com> References: <20240522085056.54818-1-xni@redhat.com> Precedence: bulk X-Mailing-List: linux-raid@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 It fails when hostname lenght > 32. Because the super1 metadata name doesn't include hostname when hostname length > 32. Then mdadm thinks the array is a foreign array if no device link is specified when assembling the array. It chooses a minor number from 127. Signed-off-by: Xiao Ni --- test | 3 +++ tests/03assem-incr | 20 +++++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/test b/test index 814ce1992b0c..1fce6be2c4a9 100755 --- a/test +++ b/test @@ -33,6 +33,9 @@ LVM_VOLGROUP=mdtest md0=/dev/md0 md1=/dev/md1 md2=/dev/md2 +# if user doesn't specify minor number, mdadm chooses minor number +# automatically from 127. +md127=/dev/md127 mdp0=/dev/md_d0 mdp1=/dev/md_d1 diff --git a/tests/03assem-incr b/tests/03assem-incr index 38880a7fed10..21215a34f93b 100644 --- a/tests/03assem-incr +++ b/tests/03assem-incr @@ -9,15 +9,21 @@ set -x -e levels=(raid0 raid1 raid5) if [ "$LINEAR" == "yes" ]; then - levels+=( linear ) + levels+=( linear ) fi for l in ${levels[@]} do - mdadm -CR $md0 -l $l -n5 $dev0 $dev1 $dev2 $dev3 $dev4 --assume-clean - mdadm -S md0 - mdadm -I $dev1 - mdadm -I $dev3 - mdadm -A /dev/md0 $dev0 $dev1 $dev2 $dev3 $dev4 - mdadm -S /dev/md0 + mdadm -CR $md0 -l $l -n5 $dev0 $dev1 $dev2 $dev3 $dev4 --assume-clean + mdadm -S $md0 + mdadm -I $dev1 + mdadm -I $dev3 + mdadm -A $md0 $dev0 $dev1 $dev2 $dev3 $dev4 + # If one array is foreign (metadata name doesn't have the machine's + # hostname), mdadm chooses a minor number automatically from 127 + if [ $is_foreign == "no" ]; then + mdadm -S $md0 + else + mdadm -S $md127 + fi done From patchwork Wed May 22 08:50:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Ni X-Patchwork-Id: 13670601 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A716E7710B for ; Wed, 22 May 2024 08:51:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367891; cv=none; b=VnLMjDg2/IzcPwWGv46x4bKuXp/YGeqhH4vSqGt4yRBXUtHm+n/G0sOAD5VzQBjCvbMIwiTsOQaZSJOpKKFjnL8xzhdR8BQiF6CchPtbbY+3cX8JIKhEaAgW7K6w1SMkHHd3eSiD3W7EZlhjU9a6XuNJrSy9EJwFXx99WhecaOg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367891; c=relaxed/simple; bh=l1SrnFwW2KxS5mD6g+skSmicK6eIG9bR9r2+aSCCvMg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UkUST+ypjnUFXHaWcYyguTb4/6EkU3A05eopSgzO16xoHz0hExiJnM5uW0TD9m0oaAbnRkCPpihWB1xlsOT0VeR6CNcrcrOg/15Ep2qoycwUPpvJx4p+IBPf0LChrw6W8+Xz5muWWLyQGzCXqZbFnp/MC6u60n1sGrvuSSgEL5Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=FVpnwfYg; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="FVpnwfYg" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716367888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QOTPAR2efWEZLNazphRhIdUyjx0OPUZCG46N8d4Dje8=; b=FVpnwfYgarKmIWsi9eus4oLOqZinz4B0ghRr6qKCt4SF0kjoHIxeRXCv2Gb9s/jo2BelwZ JPOGYvz6md0ZsX8/h/MOeKq3YZziXjw+jYqL3s+3Z8s77ClyLVriMqkVIqqb06wMozcZ49 b1NWp0L73QgPr4+lzd8GXatz6jLR2Qg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-591-0tt_Tic1PLCZ5WGYqD3YGg-1; Wed, 22 May 2024 04:51:24 -0400 X-MC-Unique: 0tt_Tic1PLCZ5WGYqD3YGg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6844C81227E; Wed, 22 May 2024 08:51:24 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3411EC15BB9; Wed, 22 May 2024 08:51:21 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: linux-raid@vger.kernel.org, heinzm@redhat.com, ncroxon@redhat.com Subject: [PATCH 08/19] mdadm/tests 03r0assem enhance Date: Wed, 22 May 2024 16:50:45 +0800 Message-Id: <20240522085056.54818-9-xni@redhat.com> In-Reply-To: <20240522085056.54818-1-xni@redhat.com> References: <20240522085056.54818-1-xni@redhat.com> Precedence: bulk X-Mailing-List: linux-raid@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 dcc22ae74a864 ('super1: remove support for name= in config') already removes name= support. So remove related test codes in 03r0assem. Signed-off-by: Xiao Ni --- tests/03r0assem | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tests/03r0assem b/tests/03r0assem index f7c29e8c1ab6..4bf8b9e83b0f 100644 --- a/tests/03r0assem +++ b/tests/03r0assem @@ -33,16 +33,6 @@ mdadm -As -c $conf $md2 $tst mdadm -S $md2 -{ - echo DEVICE $devlist - echo array $md2 name=2 -} > $conf - -mdadm -As -c $conf $md2 -$tst -mdadm -S $md2 - - { echo DEVICE $devlist echo array $md2 devices=$dev0,$dev1,$dev2 From patchwork Wed May 22 08:50:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Ni X-Patchwork-Id: 13670602 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B194E8004F for ; Wed, 22 May 2024 08:51:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367893; cv=none; b=nuBG5f2MgzHr2LTJG0LMcuLyH4SVDNuIQvPuA6JW1Z6XevPEb2b71lZnX1KeHaPLCObRccBB+gkQVQDQ9uDq69GJL4RFhVy8GVDC/UVMDuFwvE8ecf8n72a/BOrNvPcpqeVp7Zz+BkMsyIuCojg5OnbDpATOBm3kdN1/Rofy08M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367893; c=relaxed/simple; bh=DbtycjBvs9gkptJJKXkGmQmYh9sIk1b0zAx+oeyHkBM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qufH6dMA+6qvAcsh9OuCgx9CgvXVpT6LCs1yEMTyJ4bkF9NrOIune3sliJgrClY85XOXBX/XTArIUHoGL9ODO+sUteHIM/7DUdnkSy1Eu7jZfLIYmhn0DUUljv+NkyTQAL2mfk4NjC3+Qb1jIj8ZSdX5s8OEo+e/iaiTIKxpZW8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=E98lyyrd; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="E98lyyrd" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716367890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2vVCTIsyPQmrNfiB0nS1dzR/Y1pZJ0r5kzlaMEGldYc=; b=E98lyyrd5/Ky7Z3tkTHb3EV55G5th0I90DVS8kChZbI7Be00/dRuuS5qvF/+sZEnDguz/i hXOktPdmYjKctJGYuB2kC6mwqt1/ZbDckyIhVnpyie+ZmbHMRp+IhiPpez5qYUY3olBK58 wTPm4zny4ETsodKXcQtm0LhDFqD3Gl8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-655-u4AXZkllN_WydQbtgzSv_g-1; Wed, 22 May 2024 04:51:27 -0400 X-MC-Unique: u4AXZkllN_WydQbtgzSv_g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 24FDF800994; Wed, 22 May 2024 08:51:27 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 18C57C15BB1; Wed, 22 May 2024 08:51:24 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: linux-raid@vger.kernel.org, heinzm@redhat.com, ncroxon@redhat.com Subject: [PATCH 09/19] mdadm/tests: remove 03r5assem-failed Date: Wed, 22 May 2024 16:50:46 +0800 Message-Id: <20240522085056.54818-10-xni@redhat.com> In-Reply-To: <20240522085056.54818-1-xni@redhat.com> References: <20240522085056.54818-1-xni@redhat.com> Precedence: bulk X-Mailing-List: linux-raid@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 03r5assem can run successfully with kernel 6.9.0-rc4 Signed-off-by: Xiao Ni --- tests/03r5assem-failed | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 tests/03r5assem-failed diff --git a/tests/03r5assem-failed b/tests/03r5assem-failed deleted file mode 100644 index d38241df0228..000000000000 --- a/tests/03r5assem-failed +++ /dev/null @@ -1,12 +0,0 @@ - -# Create an array, fail one device while array is active, stop array, -# then re-assemble listing the failed device first. - -mdadm -CR $md1 -l5 -n4 $dev0 $dev1 $dev2 $dev3 -check wait - -echo 2000 > /sys/block/md1/md/safe_mode_delay -mkfs $md1 -mdadm $md1 -f $dev0 -mdadm -S $md1 -mdadm -A $md1 $dev0 $dev1 $dev2 $dev3 || exit 1 From patchwork Wed May 22 08:50:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Ni X-Patchwork-Id: 13670603 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C77D48004F for ; Wed, 22 May 2024 08:51:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367896; cv=none; b=oDux42Tyedd3+2j5zl2y1FAIWqUbUNI9b9Mcjq8Ew/V+xL+/q8i+NQZDbdt0fqmA8T8i+PPhPZpVElbWMjHcaJReg09IMsf1iFtsBGfSqvLPg+JR6IyXUY9HXNY1knriXy35t+xTJjHDu+n0yE2npcJJrv0Yo/l+33glQz9+6N8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367896; c=relaxed/simple; bh=/GuaZGMQJmEple0O+cjvYy6XNIECU1psG4eVCsKZhLc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=f0gTYMhLZiTmmC4Rn30O82P16uNiouTGbuJI9tzBIIZLK81geOCIpPODecY/uRmMphd1BA/t8Cjb6mcR7lNmAb+eTsPwyHzvFh5uMql7asxonA/6lbIzWQEOLkBhy4QGYC44SMjIe5zTL3NGSNjZk8xv2KPI+IUGxVBdwlrViDs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=OljxBQqs; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OljxBQqs" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716367894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8UIWk+2sy8Psc5T6UUGLVTcH29pzSIxTbNaWd3gDutU=; b=OljxBQqsiWVF99/JXhvX6Z3pGlU5npipp3mmsyaMUCLKFCLyyER/oF+f4tp4JLw/VYSATK /xI+L8hS7inY6KG5pXOtoi4EeNpjQXxUZM+I2FKyhaiNnxe+960qakCHyz2JlGSRh1zJSN BpfKEW7EdS8OdwAcnLx1AgbWe2c5aMk= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-244-VhrTH5avPkmeHDS_PAoYYA-1; Wed, 22 May 2024 04:51:30 -0400 X-MC-Unique: VhrTH5avPkmeHDS_PAoYYA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E77D829AA3AD; Wed, 22 May 2024 08:51:29 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id C50DFC15BB1; Wed, 22 May 2024 08:51:27 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: linux-raid@vger.kernel.org, heinzm@redhat.com, ncroxon@redhat.com Subject: [PATCH 10/19] mdadm/tests: 03r5assemV1 Date: Wed, 22 May 2024 16:50:47 +0800 Message-Id: <20240522085056.54818-11-xni@redhat.com> In-Reply-To: <20240522085056.54818-1-xni@redhat.com> References: <20240522085056.54818-1-xni@redhat.com> Precedence: bulk X-Mailing-List: linux-raid@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 dcc22ae74a864 ('super1: remove support for name= in config') already removes name= support. So remove related test codes in 03r5assemV1. Signed-off-by: Xiao Ni --- tests/03r5assemV1 | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/tests/03r5assemV1 b/tests/03r5assemV1 index bca0c583724b..6026011eda93 100644 --- a/tests/03r5assemV1 +++ b/tests/03r5assemV1 @@ -31,14 +31,6 @@ conf=$targetdir/mdadm.conf mdadm -As -c $conf $md1 eval $tst -{ - echo DEVICE $devlist - echo array $md1 name=one -} > $conf - -mdadm -As -c $conf -eval $tst - { echo DEVICE $devlist echo array $md1 devices=$dev0,$dev1,$dev2,$dev3,$dev4 @@ -88,15 +80,6 @@ mdadm -As -c $conf $md1 check state U_U eval $tst -{ - echo DEVICE $devlist - echo array $md1 name=one -} > $conf - -mdadm -As -c $conf -check state U_U -eval $tst - { echo DEVICE $devlist echo array $md1 devices=$dev0,$dev1,$dev2 From patchwork Wed May 22 08:50:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Ni X-Patchwork-Id: 13670604 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5DE0380046 for ; Wed, 22 May 2024 08:51:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367898; cv=none; b=hcj5tWNuYq2sjoXxADeNnreCfEgnNVgvnz2XGsPMPliyKOQo8lgIkUXsWeO6klhDLke9Knqzke9nuRHQRSUadexCjOJzpmHbdiJ11WmsnlfOdPqMYJFaRQ9kW4+wwU5n0TCBmB5EfWJ21fQ0Sd6reVdf9AUbocLRvUQTEkBt2c0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367898; c=relaxed/simple; bh=OR0aFEN1IhjDI7YC5RyTQ8ANIcbPUIO/FISY2nzKG8s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=P1pBUD/UGxM/WNt5i2bigJLK1hciMOcSAYV2UBapQRTKMOyRW6Xb2pPNgE8pqiFdLeZ98I/QYBebD/kPhtrvg7JjxI2qx7wQMuGbCv1yU6zcTim14Vbgib2H2RXsC464QzwlX15BUUemBo1oocB8TbzXARiQeSfmhWbQVKMuxq0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=eCPeQ3F8; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="eCPeQ3F8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716367896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ooQOAreuMbpouY101LYWlanPXoFQq72Qm9ZwGqkj/1I=; b=eCPeQ3F86FXKpM1f2jSJQjNslLKQj4aa/ix95XyF1tWkHLipqUJQgopqfWg4n/BDTK4ERN FpdQrLiorNGBHaZz+Ic30jnO03/IhmV8NN0utc3xjer9Pnp94z4qSiIhU6QA7jgWP9Myte 172ClOdtF2L44YHizorRoX6Of+GrAXI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-314-PSFGRwqfPPKtK759j4zgRw-1; Wed, 22 May 2024 04:51:33 -0400 X-MC-Unique: PSFGRwqfPPKtK759j4zgRw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CA75D85A58C; Wed, 22 May 2024 08:51:32 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id A9276C15BB1; Wed, 22 May 2024 08:51:30 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: linux-raid@vger.kernel.org, heinzm@redhat.com, ncroxon@redhat.com Subject: [PATCH 11/19] mdadm/tests: remove 04r5swap.broken Date: Wed, 22 May 2024 16:50:48 +0800 Message-Id: <20240522085056.54818-12-xni@redhat.com> In-Reply-To: <20240522085056.54818-1-xni@redhat.com> References: <20240522085056.54818-1-xni@redhat.com> Precedence: bulk X-Mailing-List: linux-raid@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 04r5swap can run successfully with kernel 6.9.0-rc4 Signed-off-by: Xiao Ni --- tests/04r5swap.broken | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 tests/04r5swap.broken diff --git a/tests/04r5swap.broken b/tests/04r5swap.broken deleted file mode 100644 index e38987dbf01b..000000000000 --- a/tests/04r5swap.broken +++ /dev/null @@ -1,7 +0,0 @@ -always fails - -Fails with errors: - - mdadm: /dev/loop0 has no superblock - assembly aborted - - ERROR: no recovery happening From patchwork Wed May 22 08:50:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Ni X-Patchwork-Id: 13670605 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0021C8061D for ; Wed, 22 May 2024 08:51:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367901; cv=none; b=Ftb7pSy3jFjkbMu/RPetBaMKu2xi0zGQnX5/28PNgRqa3HmjWqaelPXv4WM3LWIkY3GP+BK50rpF4vTw21ggdKAeaPGnwWr2Wz6Sqmi0CxeaRgqtAwIcthV4wAsapuKUXTwaw5h4/cyXLoI7V9jczL8SM2uZeK3ZlDd7vaPM8dg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367901; c=relaxed/simple; bh=nE9N3R3u/QOVcgko8IDM2ORatbLD5kaH/IaycOUPdBA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CjN5p9T62y1iB8uGcDU+UZiBQILSEwQis5R5zp//ecklhxHBMwHyByAz44BCehI3/IpdZ03fp8/NdD0PEwxlC5jDa/37ssMEiHWLnsCpkMUzWaF1KS8XhrBIqoXXERH1PYJHTRpg0xxwVlD0PD/Ph4OMbnlsBtqruc9qF9czxxQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=RPsL3pV3; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="RPsL3pV3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716367899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WTcVoEJwggvtKBTdZqG77P43Xyr1obP5tzEjjukDYWA=; b=RPsL3pV3tXRXDU95yCSS3efUGSerfJ6rIXGKhzBr6wYsKZwd/lKqXHXU1ZAde/lyogNzvI kWcHRn2lbY1wt5zoVwip63tTN87QgBEHcOfcOiEUKxNYHiwEiV5baW+UShoMm9BwSi4oko EhuKiH4+3+ovbLm/MxcwibKo4zNWJtw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-683-5vipM5KvP_KYCbERWieoaA-1; Wed, 22 May 2024 04:51:35 -0400 X-MC-Unique: 5vipM5KvP_KYCbERWieoaA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8CD1A800994; Wed, 22 May 2024 08:51:35 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7DA43C15BB1; Wed, 22 May 2024 08:51:33 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: linux-raid@vger.kernel.org, heinzm@redhat.com, ncroxon@redhat.com Subject: [PATCH 12/19] tests/04update-metadata skip linear Date: Wed, 22 May 2024 16:50:49 +0800 Message-Id: <20240522085056.54818-13-xni@redhat.com> In-Reply-To: <20240522085056.54818-1-xni@redhat.com> References: <20240522085056.54818-1-xni@redhat.com> Precedence: bulk X-Mailing-List: linux-raid@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 Add one check that if kernel doesn't support linear/multipath, it can skip linear/multipath testing. Signed-off-by: Xiao Ni --- test | 3 +++ tests/04update-metadata | 35 ++++++++++++++++++++--------------- tests/func.sh | 2 ++ 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/test b/test index 1fce6be2c4a9..f09994e78107 100755 --- a/test +++ b/test @@ -17,6 +17,9 @@ devlist= # device node will be /dev/md127 (127 is choosed by mdadm autumatically) is_foreign="no" +skipping_linear="no" +skipping_multipath="no" + savelogs=0 exitonerror=1 ctrl_c_error=0 diff --git a/tests/04update-metadata b/tests/04update-metadata index 2b72a303b6a0..c748770cfda7 100644 --- a/tests/04update-metadata +++ b/tests/04update-metadata @@ -8,24 +8,29 @@ set -xe dlist="$dev0 $dev1 $dev2 $dev3" -for ls in linear/4 raid1/1 raid5/3 raid6/2 +if [ $skipping_linear == "yes" ]; then + level_list="raid1/1 raid5/3 raid6/2" +else + level_list="linear/4 raid1/1 raid5/3 raid6/2" +fi +for ls in $level_list do - s=${ls#*/} l=${ls%/*} - 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 - testdev $md0 $s 19904 64 check - mdadm -S $md0 + s=${ls#*/} l=${ls%/*} + 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 + testdev $md0 $s 19904 64 check + mdadm -S $md0 done if mdadm -A $md0 --update=metadata $dlist then echo >&2 should fail with v1.0 metadata - exit 1 + exit 1 fi mdadm -CR -e 0.90 $md0 --level=6 -n4 -c32 $dlist @@ -33,7 +38,7 @@ mdadm -S $md0 if mdadm -A $md0 --update=metadata $dlist then echo >&2 should fail during resync - exit 1 + exit 1 fi mdadm -A $md0 $dlist mdadm --wait $md0 || true @@ -48,5 +53,5 @@ mdadm -S $md0 if mdadm -A $md0 --update=metadata $dlist then echo >&2 should fail when bitmap present - exit 1 + exit 1 fi diff --git a/tests/func.sh b/tests/func.sh index cfe83e552a2a..db55542d4011 100644 --- a/tests/func.sh +++ b/tests/func.sh @@ -125,6 +125,7 @@ check_env() { MULTIPATH="yes" if [ "$MULTIPATH" != "yes" ]; then echo "test: skipping tests for multipath, which is removed in upstream 6.8+ kernels" + skipping_multipath="yes" fi # Check whether to run linear tests @@ -133,6 +134,7 @@ check_env() { LINEAR="yes" if [ "$LINEAR" != "yes" ]; then echo "test: skipping tests for linear, which is removed in upstream 6.8+ kernels" + skipping_linear="yes" fi } From patchwork Wed May 22 08:50:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Ni X-Patchwork-Id: 13670606 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4A4E80C02 for ; Wed, 22 May 2024 08:51:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367902; cv=none; b=L6wuMWPczN7lcxy0KctzkJW3/MkviUtnDCyXxaxg5J/G8FtNzawz+nODp3zyd0TEhLHRpvSMzjfRA0mmd7SxGytfNRc5/hqYQmJ/AwloBTrgHTQ4D7CGOhqk7WqFEt1nkwq/JTGlk8F5flpwECnVdTGXKlAFSFXgZcz8tQo/e2I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367902; c=relaxed/simple; bh=5xUPaEtqmOH8zFJI1HONRBqiaBrlA20Z+OEw6MAFYIM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hnoSuDE/xMDFJGY1Dz7wkoAZ5bot1WqM4u1EIdYolqatfdVOU6I1cuQEiHewcu08cxIf9TIscDRpttwcHIWE4qY3rZHTv0EB5JAs5YjDQhOp2luBqNRxJwr1MOcnWNoqYrJN48G9b1Di46kxle9lTOIFws0zwybOExVvBMoczVA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=WFqWveE1; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="WFqWveE1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716367899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PYaQDtJHmMpCb8zjIGzjwPFn0qKa2wuj0i0b+ergjwc=; b=WFqWveE1Nb2jxTo9be6DrFoK+nz3aUyU9OXOKDj7Ppcj69U/WXCwyQPaa5fjD0FPkd5cFD N8GmbIxvYSyyJSb/mEMVm3YMgZJZ8GnoXpWxTCZGGg9WX+yiih+5QE6wJArwNgqbtKpG/2 TKtuVRWkn88OzTU5bj5IBS74zfVvMuc= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-686-3ZcGD0kpPRmyWXnaHWKLzg-1; Wed, 22 May 2024 04:51:38 -0400 X-MC-Unique: 3ZcGD0kpPRmyWXnaHWKLzg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 40A5A3800089; Wed, 22 May 2024 08:51:38 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 33863C15BB1; Wed, 22 May 2024 08:51:35 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: linux-raid@vger.kernel.org, heinzm@redhat.com, ncroxon@redhat.com Subject: [PATCH 13/19] mdadm/tests: 05r5-internalbitmap Date: Wed, 22 May 2024 16:50:50 +0800 Message-Id: <20240522085056.54818-14-xni@redhat.com> In-Reply-To: <20240522085056.54818-1-xni@redhat.com> References: <20240522085056.54818-1-xni@redhat.com> Precedence: bulk X-Mailing-List: linux-raid@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 It's not right to compare bitmap bits with a number after io comes. Because maybe those bits are already flused. Remove the related tests. Signed-off-by: Xiao Ni --- tests/05r5-internalbitmap | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/tests/05r5-internalbitmap b/tests/05r5-internalbitmap index 13dc59215c1c..1a64482f11dd 100644 --- a/tests/05r5-internalbitmap +++ b/tests/05r5-internalbitmap @@ -9,21 +9,20 @@ mdadm -S $md0 mdadm --assemble $md0 $dev1 $dev2 $dev3 testdev $md0 2 $mdsize1 512 -dirty1=`mdadm -X $dev2 | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` sleep 4 -dirty2=`mdadm -X $dev2 | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` +dirty1=`mdadm -X $dev2 | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` -if [ $dirty1 -lt 400 -o $dirty2 -ne 0 ] -then echo >&2 "ERROR bad 'dirty' counts: $dirty1 and $dirty2" +if [ $dirty1 -ne 0 ] +then echo >&2 "ERROR bad 'dirty' counts: $dirty1" exit 1 fi mdadm $md0 -f $dev1 testdev $md0 2 $mdsize1 512 sleep 4 -dirty3=`mdadm -X $dev2 | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` -if [ $dirty3 -lt 400 ] +dirty2=`mdadm -X $dev2 | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` +if [ $dirty2 -lt 400 ] then - echo >&2 "ERROR dirty count $dirty3 is too small" + echo >&2 "ERROR dirty count $dirty2 is too small" exit 2 fi @@ -33,14 +32,12 @@ mdadm --assemble -R $md0 $dev2 $dev3 mdadm --zero $dev1 # force --add, not --re-add mdadm $md0 --add $dev1 check recovery - -dirty4=`mdadm -X $dev2 | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` check wait sleep 4 -dirty5=`mdadm -X $dev2 | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` +dirty3=`mdadm -X $dev2 | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` -if [ $dirty4 -lt 400 -o $dirty5 -ne 0 ] -then echo echo >&2 "ERROR bad 'dirty' counts at end: $dirty4 $dirty5" +if [ $dirty3 -ne 0 ] +then echo echo >&2 "ERROR bad 'dirty' counts at end: $dirty3" exit 1 fi From patchwork Wed May 22 08:50:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Ni X-Patchwork-Id: 13670607 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A3E480039 for ; Wed, 22 May 2024 08:51:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367904; cv=none; b=WOVqS4Be9EG+hhVDQ7pc3zqC6yGmn8RmbR8rvEIXmlY19OvPaseoFG7M2AUj0MLJk7zln2NRE7jj/nyEAalixjDd4B0Zp6F92ywRrT3WaezYrMXGpj1BYM9365GVrca1sTjlI1lkiP8FEqkFiXXGtGh8v+EP1+bfvJgW7LqbyYk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367904; c=relaxed/simple; bh=vPnqFPNvWOcZVPDfSRKzJmhyIb0hT5Qh3BzPNZuApmU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gUvGKFODcqEKyLm5aVR9tiUJXIa908v+9K77NntGjsnFrwAmQ9bXkmsyqNgvBzDjWY0ZWnhk1xLi3Lfi4JAUJrAHDuh2019YTbdi5a+pgpyPeYsAKQFTgeaqZsaPGeVMBlpFwzLQQ+jb/x35fx6dIMgHKmpP2N/5jPaz9DHb8Jc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Gxwt5p/d; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Gxwt5p/d" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716367902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6Ce6yvrzH3UM/tiCTa9fVHso6tB/+62b1/FqPOe0gQU=; b=Gxwt5p/dJszeqjzLL3QOZaLLutKNhFJeqcrK73UJCcLayMpSxLa7pCWSCjJ2yiXhrBh/zd wT6zacR/AWkU1aq3+fk03n0p0/UHGqwag3MZKHY1aMIu9bcl5O0brune6//Q0Jv1c0yoM/ SKRYsKbiYcoVHF0JlqccIvf7lo2terw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-244-XMPooH4-PPepar5f5H8ueg-1; Wed, 22 May 2024 04:51:41 -0400 X-MC-Unique: XMPooH4-PPepar5f5H8ueg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1919680118E; Wed, 22 May 2024 08:51:41 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id EBF50C15BB1; Wed, 22 May 2024 08:51:38 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: linux-raid@vger.kernel.org, heinzm@redhat.com, ncroxon@redhat.com Subject: [PATCH 14/19] mdadm/tests: 05r6-bitmapfile Date: Wed, 22 May 2024 16:50:51 +0800 Message-Id: <20240522085056.54818-15-xni@redhat.com> In-Reply-To: <20240522085056.54818-1-xni@redhat.com> References: <20240522085056.54818-1-xni@redhat.com> Precedence: bulk X-Mailing-List: linux-raid@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 It's not right to compare bitmap bits with a number after io comes. Because maybe those bits are already flused. Remove the related tests. Signed-off-by: Xiao Ni --- tests/05r6-bitmapfile | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/tests/05r6-bitmapfile b/tests/05r6-bitmapfile index d11896db221c..df66e59462cb 100644 --- a/tests/05r6-bitmapfile +++ b/tests/05r6-bitmapfile @@ -11,21 +11,20 @@ mdadm -S $md0 mdadm --assemble $md0 --bitmap=$bmf $dev1 $dev2 $dev3 $dev4 testdev $md0 2 $mdsize1 512 -dirty1=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` sleep 4 -dirty2=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` +dirty1=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` -if [ $dirty1 -lt 400 -o $dirty2 -ne 0 ] -then echo >&2 "ERROR bad 'dirty' counts: $dirty1 and $dirty2" +if [ $dirty1 -ne 0 ] +then echo >&2 "ERROR bad 'dirty' counts: $dirty1" exit 1 fi mdadm $md0 -f $dev3 testdev $md0 2 $mdsize1 512 sleep 4 -dirty3=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` -if [ $dirty3 -lt 400 ] +dirty2=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` +if [ $dirty2 -lt 400 ] then - echo >&2 "ERROR dirty count $dirty3 is too small" + echo >&2 "ERROR dirty count $dirty2 is too small" exit 2 fi @@ -35,14 +34,12 @@ mdadm --assemble -R $md0 --bitmap=$bmf $dev1 $dev2 $dev4 mdadm --zero $dev3 # force --add, not --re-add mdadm $md0 --add $dev3 check recovery - -dirty4=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` check wait sleep 4 -dirty5=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` +dirty3=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` -if [ $dirty4 -lt 400 -o $dirty5 -ne 0 ] -then echo echo >&2 "ERROR bad 'dirty' counts at end: $dirty4 $dirty5" +if [ $dirty3 -ne 0 ] +then echo echo >&2 "ERROR bad 'dirty' counts at end: $dirty3" exit 1 fi From patchwork Wed May 22 08:50:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Ni X-Patchwork-Id: 13670608 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C6F0A46522 for ; Wed, 22 May 2024 08:51:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367910; cv=none; b=NekokiHa7TOpIX21esWHtFiXwCgUaF7AHsNgS0ZaGTFwGt/HdHneGrlpzdpsGMIVl+OE7I/3y6kUwvwsTmJ0/XTMQVzn42b1wahQHHI1ocNxBMMtknCZf2K3iNrCFsP4JQjV9azslQ/8naev9YCILilMxcLyIElksQJ4Ms+e470= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367910; c=relaxed/simple; bh=Ki+m0fJLOynfQuU74ZsWm41Hjvi3IKWcnlW7vrtjvpc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rJc1QWhILZjxMhMC1KwwFv8Io2ibZSj8PnFCbUvYkEpGHWXzbhd7jeU4V7b+xphBtjuBkv4hD3JBoHCqNwWz62KOqG2MwiU34+27ogphWRXyb4kjvVjURcQ/JkffWGYubcdLfnhM7hZu3NekMGK8rXvserD21ugqkFIOiOHnRxk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=GeOotfie; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="GeOotfie" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716367907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/O1W5i9/giphgtMY4vltoNSUnOeEOu1D0dJ6hrZW63A=; b=GeOotfie/4hHlUVNvNne4jjRdlT7DP41rU78+a3OD8UkmZcVNtuz85/0Gj97z8cl+lyfnJ ZG4tMs0QDma4Q7YCcaWIevmG7uH42KCxFuzE2IHTSKZiOkIix9XpghmPbvE+D2b+pmT3wm 5rzzQvu++x+SeC8T3tQ1DxxbXRZldfg= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-130-A6K6T9O9NYGBLwCNa0zhRQ-1; Wed, 22 May 2024 04:51:44 -0400 X-MC-Unique: A6K6T9O9NYGBLwCNa0zhRQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EC7CD3800089; Wed, 22 May 2024 08:51:43 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id E3B3AC15BB9; Wed, 22 May 2024 08:51:41 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: linux-raid@vger.kernel.org, heinzm@redhat.com, ncroxon@redhat.com Subject: [PATCH 15/19] mdadm/tests: 06name enhance Date: Wed, 22 May 2024 16:50:52 +0800 Message-Id: <20240522085056.54818-16-xni@redhat.com> In-Reply-To: <20240522085056.54818-1-xni@redhat.com> References: <20240522085056.54818-1-xni@redhat.com> Precedence: bulk X-Mailing-List: linux-raid@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 It needs to check hostname in metadata name if one array is local. Add the check in this case. Signed-off-by: Xiao Ni --- tests/06name | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/06name b/tests/06name index 86eaab69e3a1..c3213f6c9f7b 100644 --- a/tests/06name +++ b/tests/06name @@ -3,8 +3,14 @@ set -x # create an array with a name mdadm -CR $md0 -l0 -n2 --metadata=1 --name="Fred" $dev0 $dev1 -mdadm -E $dev0 | grep 'Name : Fred' > /dev/null || exit 1 -mdadm -D $md0 | grep 'Name : Fred' > /dev/null || exit 1 + +if [ $is_foreign == "no" ]; then + mdadm -E $dev0 | grep "Name : $(hostname):Fred" > /dev/null || exit 1 + mdadm -D $md0 | grep "Name : $(hostname):Fred" > /dev/null || exit 1 +else + mdadm -E $dev0 | grep "Name : Fred" > /dev/null || exit 1 + mdadm -D $md0 | grep "Name : Fred" > /dev/null || exit 1 +fi mdadm -S $md0 mdadm -A $md0 --name="Fred" $devlist From patchwork Wed May 22 08:50:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Ni X-Patchwork-Id: 13670609 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD38046522 for ; Wed, 22 May 2024 08:51:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367913; cv=none; b=HVNxlY9TwMwy57fys/eRFGXSfkD19k2RLLz6/hgPiAKL9DqOXOvtHRIvrfLxbsXJRFCa8zQqR9Epj5IrCluJQ7VcUsZSLYIXfO2owiRaQP1QL96xx5Kund2UPWU7AEi9zt0OdD1HHyhRLJkVykOmdZOQ8zD6LaQMaP/xPXmXhjE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367913; c=relaxed/simple; bh=SOZ59asLs27lMDTwpwYPIfrmXcSoq+KoQgz8ezZHN2s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=EQn4Pl3+QgfU7rGi1HK+Wx8tCZ/nslu9XLvI83Ptqc627K2sYAstN1MJxU19nnwVXHx6SBDNPvKYxPOmrJNV2tMlLVNVm5/BF5yZgXT3LEYZHG+yVFxhzseFrFMldJJHwZwaF8rWjgH5jK4A+seQcwJojjRevzmYXGMfYJmJtRo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=YBUk8veQ; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="YBUk8veQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716367910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OVO7qCTniPvXgcAneiPeJ8scOpW7Dk2H/zPoE1J8DSQ=; b=YBUk8veQZMn6Md9Y/5ZY+XJxb4hUv08xX+DicTFKmsSaF/AeXxVYEXOlow/bozBmPdow7o s4qSDnWWRhGIOBBN64OGldJDFPN93/uWwwHCdMRc5fN4d6uclMviy0AAc8rYvSvpyfD03V yADSEIwtQU9VtNhxqIPeEK2s1CBFOI4= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-329-__w5f3ypP-io3QihPszqBQ-1; Wed, 22 May 2024 04:51:47 -0400 X-MC-Unique: __w5f3ypP-io3QihPszqBQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C552A3C025BE; Wed, 22 May 2024 08:51:46 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id B05C0C15BB1; Wed, 22 May 2024 08:51:44 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: linux-raid@vger.kernel.org, heinzm@redhat.com, ncroxon@redhat.com Subject: [PATCH 16/19] mdadm/tests: 07autoassemble Date: Wed, 22 May 2024 16:50:53 +0800 Message-Id: <20240522085056.54818-17-xni@redhat.com> In-Reply-To: <20240522085056.54818-1-xni@redhat.com> References: <20240522085056.54818-1-xni@redhat.com> Precedence: bulk X-Mailing-List: linux-raid@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 This test is used to test stacked array auto assemble. There are two different cases depends on if array is foreign or not. If the array is foreign, the stacked array (md0 is on md1 and md2) can't be assembled with name md0. Because udev rule will run when md1 and md2 are assembled and mdadm -I doesn't specify homehost. So it will treat stacked array (md0) as foreign array and choose md127 as the device node name (/dev/md127) Add the case that stacked array is local. Signed-off-by: Xiao Ni --- test | 2 ++ tests/07autoassemble | 37 +++++++++++++++++++++++++++++++++++-- tests/07autoassemble.broken | 8 -------- 3 files changed, 37 insertions(+), 10 deletions(-) delete mode 100644 tests/07autoassemble.broken diff --git a/test b/test index f09994e78107..4a88de58fdf5 100755 --- a/test +++ b/test @@ -39,6 +39,8 @@ md2=/dev/md2 # if user doesn't specify minor number, mdadm chooses minor number # automatically from 127. md127=/dev/md127 +md126=/dev/md126 +md125=/dev/md125 mdp0=/dev/md_d0 mdp1=/dev/md_d1 diff --git a/tests/07autoassemble b/tests/07autoassemble index e689be7c4a10..9dc781497070 100644 --- a/tests/07autoassemble +++ b/tests/07autoassemble @@ -10,7 +10,14 @@ mdadm -Ss mdadm -As -c /dev/null --homehost=testing -vvv testdev $md1 1 $mdsize1a 64 testdev $md2 1 $mdsize1a 64 -testdev $md0 2 $mdsize11a 512 +# md1 and md2 will be incremental assemble by udev rule. And +# the testing machines' hostname is not testing. The md0 will +# be considered as a foreign array. It can use 0 as metadata +# name. md127 will be used +testdev $md127 2 $mdsize11a 512 +mdadm --stop $md127 +mdadm --zero-superblock $md1 +mdadm --zero-superblock $md2 mdadm -Ss mdadm --zero-superblock $dev0 $dev1 $dev2 $dev3 @@ -20,5 +27,31 @@ mdadm -CR $md0 -l0 -n2 $md1 $dev2 --homehost=testing mdadm -Ss mdadm -As -c /dev/null --homehost=testing -vvv testdev $md1 1 $mdsize1a 64 -testdev $md0 1 $[mdsize1a+mdsize11a] 512 +testdev $md127 1 $[mdsize1a+mdsize11a] 512 +mdadm --stop $md127 +mdadm --zero-superblock $md1 +mdadm -Ss + +# Don't specify homehost when creating raid and use the test +# machine's homehost. For super1.2, if homehost name's length +# is > 32, it doesn't use homehost name in metadata name and +# the array will be treated as foreign array +mdadm --zero-superblock $dev0 $dev1 $dev2 $dev3 +mdadm -CR $md1 -l1 -n2 $dev0 $dev1 +mdadm -CR $md2 -l1 -n2 $dev2 $dev3 +mdadm -CR $md0 -l0 -n2 $md1 $md2 +mdadm -Ss +mdadm -As -c /dev/null +if [ $is_foreign == "yes" ]; then + # md127 is md1 + testdev $md127 1 $mdsize1a 64 + # md126 is md0, udev rule incremental assemble it + testdev $md126 2 $mdsize11a 512 + # md125 is md2 + testdev $md125 1 $mdsize1a 64 +else + testdev $md1 1 $mdsize1a 64 + testdev $md2 1 $mdsize1a 64 + testdev $md0 2 $mdsize11a 512 +fi mdadm -Ss diff --git a/tests/07autoassemble.broken b/tests/07autoassemble.broken deleted file mode 100644 index 8be09407f628..000000000000 --- a/tests/07autoassemble.broken +++ /dev/null @@ -1,8 +0,0 @@ -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 From patchwork Wed May 22 08:50:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Ni X-Patchwork-Id: 13670610 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 300A180637 for ; Wed, 22 May 2024 08:51:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367915; cv=none; b=usKxufrbzBHEm9G7EmrWNcXXta+RQwnt3DyEUOjNx2DgfuMDzhyl8y4Dr+/evjad6bEQcnYRioNNp0zJjcAnrUP9VJXjIPhx/4cfh9YcKFhT0h4OyPtIooOg6PK0H0iXrB0nMfUs6CkrK6tPl/ZO9WAwaWawhn7A+9i7WVNr7bI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367915; c=relaxed/simple; bh=KODCxAxyro+C40Wa/RLau9+eeflC9es5Fe0phLgQDgo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BhcT0pY+wSHg/lNFBqZiySGnWGlxw+KjJJ9PMKKT/XoIrZ/5eKaJhz3OTXfye4etrKUw6q5Az9o3ocoqlFp6x6N/Lv0Z3fUb2RTOs8b0R++LSHkdCAIxAFOPcVY9wbKNkYiD8rWtAy32SIJ+yVpgdy0G4GWUAnzDbpAxwRshVMs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=YEQrgmb9; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="YEQrgmb9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716367913; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pv+fONxS6DyWZERO0+2KEJrLBbRXJTHfod+eULmJWIY=; b=YEQrgmb9d5qMjhsLxA76W3u1fSgJ53txBrMmQaWMGXRu2a4ayThhub14MfDxZSePTX5HBF IygldwhdoJOpz7UrUP1V0FoWA4hgBczpEv/raq7S74sezY+tvuPb3rIV1gYZ9kyRRjZbCP 61aWm3Hdg0dbPtUIJpWgvvzxDtLSpzU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-594-SJbOK5G9N5GeL7XCshqxzw-1; Wed, 22 May 2024 04:51:50 -0400 X-MC-Unique: SJbOK5G9N5GeL7XCshqxzw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DD2EC8008A4; Wed, 22 May 2024 08:51:49 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7DE40C15BB1; Wed, 22 May 2024 08:51:47 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: linux-raid@vger.kernel.org, heinzm@redhat.com, ncroxon@redhat.com Subject: [PATCH 17/19] mdadm/tests: 07autodetect.broken can be removed Date: Wed, 22 May 2024 16:50:54 +0800 Message-Id: <20240522085056.54818-18-xni@redhat.com> In-Reply-To: <20240522085056.54818-1-xni@redhat.com> References: <20240522085056.54818-1-xni@redhat.com> Precedence: bulk X-Mailing-List: linux-raid@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 07autodetect can run successfully without error in kernel 6.9.0-rc5. Signed-off-by: Xiao Ni --- tests/07autodetect.broken | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 tests/07autodetect.broken diff --git a/tests/07autodetect.broken b/tests/07autodetect.broken deleted file mode 100644 index 294954a1f50a..000000000000 --- a/tests/07autodetect.broken +++ /dev/null @@ -1,5 +0,0 @@ -always fails - -Fails with error: - - ERROR: no resync happening From patchwork Wed May 22 08:50:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Ni X-Patchwork-Id: 13670611 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2DEB7E572 for ; Wed, 22 May 2024 08:51:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367916; cv=none; b=btb1zegQPME+CLZ7S8KK1N+6x9km+mawRBqr7X+vg10sKTe1gawylA+Z/H4O1uT6XYCzlAjIWR0jDLk3aH5hpqq1TWk/2PsxVbL6tRsQo6ZZMtc5iwrctSebrC/R4a96qi335Ixis7yMBOeGGFOYighXGEl/o1nUGE6qVNoaIl4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367916; c=relaxed/simple; bh=s1Q4rGco5SIy3LcEGwUrfKI+MtryTi2WvGd+NOxWuYA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=B8Qmrxr1x68zWp2uUDznDRkc+OPFz+XYXCa/q92Ruw5k3qDvSujf7vsmxCtmowo6QOhMe+a5Z8NulSgmuDW5IMdXCStbJMhMm9sOsvkhEx6Io5Fa3wYkOg9Ue3tLqJlgc/XwWBRys4911O2Hj6Le7d+VBOUCrMG/v/BEEa1BwgM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=JQIwb9S8; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="JQIwb9S8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716367914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E2WnIGUcDlfDknpzxi7sY8IQGO68PNjb6vEiwKWTwvE=; b=JQIwb9S81aDJ8gofPWund94qyKK6bZ12EFT3NyGyNYSzcz/toJWI3InheaU3xepzfkgdhD Crq4CIQICXhR+JQgTHDTxFt1IYb928VUALk2e6sjvM0xL6WCyqnFMpGWqnAFiFxzk4HgNM YZ4egnMIOgOS88h3scGJEcadg8sJ5t0= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-41-DE37hxM0M1a6ssJDCE3aPw-1; Wed, 22 May 2024 04:51:52 -0400 X-MC-Unique: DE37hxM0M1a6ssJDCE3aPw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A1AD9380008E; Wed, 22 May 2024 08:51:52 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 88847C15BB1; Wed, 22 May 2024 08:51:50 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: linux-raid@vger.kernel.org, heinzm@redhat.com, ncroxon@redhat.com Subject: [PATCH 18/19] mdadm/tests: 07changelevelintr Date: Wed, 22 May 2024 16:50:55 +0800 Message-Id: <20240522085056.54818-19-xni@redhat.com> In-Reply-To: <20240522085056.54818-1-xni@redhat.com> References: <20240522085056.54818-1-xni@redhat.com> Precedence: bulk X-Mailing-List: linux-raid@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 It needs to specify a 2 powered array size when updating array size. If not, it can't change chunksize. And sometimes it reports error reshape doesn't happen. In fact the reshape has finished. It doesn't need to wait before checking reshape action. Because check function waits itself. Signed-off-by: Xiao Ni --- tests/07changelevelintr | 9 +++++---- tests/07changelevelintr.broken | 9 --------- 2 files changed, 5 insertions(+), 13 deletions(-) delete mode 100644 tests/07changelevelintr.broken diff --git a/tests/07changelevelintr b/tests/07changelevelintr index 18c63092071e..d921f2b284f9 100644 --- a/tests/07changelevelintr +++ b/tests/07changelevelintr @@ -27,11 +27,9 @@ checkgeo() { } restart() { - sleep 0.5 check reshape mdadm -S $md0 mdadm -A $md0 $devs --backup-file=$bu - sleep 0.5 check reshape } @@ -49,13 +47,16 @@ mdadm -G $md0 --layout rs --backup-file=$bu restart checkgeo md0 raid5 5 $[128*1024] 3 -mdadm -G $md0 --array-size 58368 +# It needs to shrink array size first. Choose a value that +# is power of 2 for array size. If not, it can't change +# chunk size. +mdadm -G $md0 --array-size 51200 mdadm -G $md0 --raid-disks 4 -c 64 --backup-file=$bu restart checkgeo md0 raid5 4 $[64*1024] 3 devs="$dev0 $dev1 $dev2 $dev3" -mdadm -G $md0 --array-size 19456 +mdadm -G $md0 --array-size 18432 mdadm -G $md0 -n 2 -c 256 --backup-file=$bu restart checkgeo md0 raid5 2 $[256*1024] 3 diff --git a/tests/07changelevelintr.broken b/tests/07changelevelintr.broken deleted file mode 100644 index 284b49068295..000000000000 --- a/tests/07changelevelintr.broken +++ /dev/null @@ -1,9 +0,0 @@ -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 From patchwork Wed May 22 08:50:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Ni X-Patchwork-Id: 13670612 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 344BC80023 for ; Wed, 22 May 2024 08:52:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367922; cv=none; b=sga+LfBvGqD1On+sF7INHSu/qjtXVHMReIJslpMRCGFnv+R3GIwAZdjyy94cNOohyTqko/GRUH65iZxJ358gKQLUsUp8mDaAjrMdflH97qoIhBDCS0ZrkO/VkjldmC1ZprYKcyvVOpT6xQ/XaNeVraOGrvwXJidbwosZXwuvpQs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716367922; c=relaxed/simple; bh=r19vEAPrzqyFIvlaqnyhgsM5kDqPimRbffwjbR+IDIo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AMekESFsVQOTJAlql5MuZgR3D53IF+TZWr0blP2LuUmDydV3tLdupx5Khh+Inbx1NgcR8P8AQtByviB9OGjrgUgU0/KccSyDacjo9CxrqKJFLGkwZD+E8mOTQYIHX4yQ7RzkpXY3y8SYIUEjDd8dhQDh4TrDxwcIRx1hD0A0Y2I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=IUBfFV12; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="IUBfFV12" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716367920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2+4mYprXFV41ZJZLQkP9ZePdTbKlGJtWMKagNC0AKyo=; b=IUBfFV12uuAkRBD28qeqkh1T8ylo0U5HYJCq3dq22122VNWXeGxU+AL++kB3uAZKhG8lTg BNHJlZ95J2haahgpKAcKteQCbVVr3rATZeftEd/0u7E0L3fYw+npnNAc5Rl/qJ6Yr6E2M7 DBHVqtYkL+boPkZGELAnENi13VcC2bI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-163-_yel7oclOn6HtNRjTVOrPQ-1; Wed, 22 May 2024 04:51:56 -0400 X-MC-Unique: _yel7oclOn6HtNRjTVOrPQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9093781227E; Wed, 22 May 2024 08:51:55 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 64AA4C15BB1; Wed, 22 May 2024 08:51:53 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: linux-raid@vger.kernel.org, heinzm@redhat.com, ncroxon@redhat.com Subject: [PATCH 19/19] mdadm/tests: disable selinux Date: Wed, 22 May 2024 16:50:56 +0800 Message-Id: <20240522085056.54818-20-xni@redhat.com> In-Reply-To: <20240522085056.54818-1-xni@redhat.com> References: <20240522085056.54818-1-xni@redhat.com> Precedence: bulk X-Mailing-List: linux-raid@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 Sometimes systemd service fails because selinux. Disable selinux during testing now. We can enable it in future when having a better method. Signed-off-by: Xiao Ni --- test | 3 +++ tests/func.sh | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/test b/test index 4a88de58fdf5..47f53ad78b75 100755 --- a/test +++ b/test @@ -16,6 +16,8 @@ devlist= # For example, /dev/md0 is created, stops it, then assemble it, the # device node will be /dev/md127 (127 is choosed by mdadm autumatically) is_foreign="no" +#disable selinux +sys_selinux="Permissive" skipping_linear="no" skipping_multipath="no" @@ -351,6 +353,7 @@ main() { fi done + restore_selinux exit 0 } diff --git a/tests/func.sh b/tests/func.sh index db55542d4011..b2e4d122aa7f 100644 --- a/tests/func.sh +++ b/tests/func.sh @@ -167,6 +167,15 @@ is_raid_foreign() { fi } +record_selinux() { + sys_selinux=`getenforce` + setenforce Permissive +} + +restore_selinux() { + setenforce $sys_selinux +} + do_setup() { trap cleanup 0 1 3 15 trap ctrl_c 2 @@ -247,6 +256,7 @@ do_setup() { echo 0 > /sys/module/md_mod/parameters/start_ro record_system_speed_limit is_raid_foreign + record_selinux } # check various things