From patchwork Wed Aug 28 02:11: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: 13780297 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 C437120309 for ; Wed, 28 Aug 2024 02:12:22 +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=1724811144; cv=none; b=UiqqPpb6fzeULQ6rhWBGWRfMTVLTOtvuGngcA+RsUf11q5d1tRZH5V3PI+/naUaddxMiTE+G+rbfsPcz+9pMiMVJ7M/KJPiJggDF8bugP22Y7inw3qZiUTdaAixRLRdTKB0W02EakXzqvHVyb47gvRhCMh8MwdVHhQLzMuixJNs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724811144; c=relaxed/simple; bh=4qfbl9hAQorvWZFfbf64JRp8MibxyiOhcrCScnW8zNI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=T3o9rah29ozbKO/fBfucE0QaPGF/m44xLyRd/3VS1lisF4SM8GF4ExcV2EtgadfUbAi4T85TuL2babH4Jqa7T3MS47TPc4STQWkiur3wc8CW7h0G2oPsx2gyJz13THcx2lA5fYSrNBb0MCfRbCMJeJ/3bdPTQz5ywer9qTlIJGY= 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=K1PFZubG; 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="K1PFZubG" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724811141; 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=GT16vcBr50+XsM1YmgUEHGZtATf0H3H7SFTEBryLmto=; b=K1PFZubGwolKxDWEvi1L2Cm7ilEIssRhQYWCxDoUaL3THOjFyA8zEEPRkEXGgXGdsOG2uu F4iJ87JWQOz6NDvs+94fkZZyMBiXPjF4uxJxpMbJcxxw2Lv8HdDE54l8J1ddTCzZgnr8st fngEaHSs+iAIJnJyOsi10PiILZEtgIQ= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-448-0MYKwHxzPY-hX9LNafSscQ-1; Tue, 27 Aug 2024 22:12:16 -0400 X-MC-Unique: 0MYKwHxzPY-hX9LNafSscQ-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C55481955BFE; Wed, 28 Aug 2024 02:12:15 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.24]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 91D0D3001FF9; Wed, 28 Aug 2024 02:12:11 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: ncroxon@redhat.com, linux-raid@vger.kernel.org Subject: [PATCH 01/10] mdadm/Grow: Update new level when starting reshape Date: Wed, 28 Aug 2024 10:11:41 +0800 Message-Id: <20240828021150.63240-2-xni@redhat.com> In-Reply-To: <20240828021150.63240-1-xni@redhat.com> References: <20240828021150.63240-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.30.177.4 Reshape needs to specify a backup file when it can't update data offset of member disks. For this situation, first, it starts reshape and then it kicks off mdadm-grow-continue service which does backup job and monitors the reshape process. The service is a new process, so it needs to read superblock from member disks to get information. But in the first step, it doesn't update new level in superblock. So it can't change level after reshape finishes, because the new level is not right. So records the new level in the first step. Signed-off-by: Xiao Ni --- Grow.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Grow.c b/Grow.c index 5810b128aa99..97e48d86a33f 100644 --- a/Grow.c +++ b/Grow.c @@ -2946,6 +2946,9 @@ static int impose_reshape(struct mdinfo *sra, if (!err && sysfs_set_num(sra, NULL, "layout", reshape->after.layout) < 0) err = errno; + if (!err && sysfs_set_num(sra, NULL, "new_level", + info->new_level) < 0) + err = errno; if (!err && subarray_set_num(container, sra, "raid_disks", reshape->after.data_disks + reshape->parity) < 0) From patchwork Wed Aug 28 02:11: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: 13780298 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 BE79220309 for ; Wed, 28 Aug 2024 02:12:25 +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=1724811147; cv=none; b=CPJ/H+F9+CZZPR2b6Y5wcXa+Sqp5ERuwxzwUHbTV5VsG+kwslrGjOpDy8qA/UiNmGRyQqK2vBQ8GCp6NCw4AN+G2DIS1g5Hvz85yUlj88CTeF0ytYGOhJMLL4uH9nmw/lmjnIvqjnaW3Vc2YvNcrf3s6g1NtWFtwgFnh/JRsULQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724811147; c=relaxed/simple; bh=lqh/hc9Hzx2n9o0HIac2typvRDkAaLjv297hZr4uO3I=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fAv/Abl1G05wrRNg3GU6IPK2nGYOHJUAgAVkz+6LuntmTpgaBtRfktes3jjluEJqfCbYhFr4f+V1TCD0UlBfIP4xZ2ifwZ0sq0gJYwfBLSi44/6syNUbTrfBFHXt8uOMy5CK6eGB4Sj2BcAG8xKrEwZiKi89hX9giEwS9KSceA4= 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=H/tCS0Yz; 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="H/tCS0Yz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724811144; 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=JKHPbuq2GYtWGqa27OUEETlYrvRxIFAn+FcJzlYKos8=; b=H/tCS0Yzw/pYhKrwZDfimV0H5QxBnm+yJE96W1O2ft9YNSRkOsmubkCVVA0Rg6HKgVxvmO KDI/0fNGoHZAR8PxssudV98bIDaxHZMKppaXe3bIb9drY4emRkEE3RrksiubYABWmYPmr5 r1bTYsNJJu0l4r+xVlRHKLzRZSvbG1Y= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-14-dxWTmRWaOqW2R8epryLyEA-1; Tue, 27 Aug 2024 22:12:21 -0400 X-MC-Unique: dxWTmRWaOqW2R8epryLyEA-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9DAB61955D54; Wed, 28 Aug 2024 02:12:20 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.24]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 453503001FF9; Wed, 28 Aug 2024 02:12:16 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: ncroxon@redhat.com, linux-raid@vger.kernel.org Subject: [PATCH 02/10] mdadm/Grow: Update reshape_progress to need_back after reshape finishes Date: Wed, 28 Aug 2024 10:11:42 +0800 Message-Id: <20240828021150.63240-3-xni@redhat.com> In-Reply-To: <20240828021150.63240-1-xni@redhat.com> References: <20240828021150.63240-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.30.177.4 It tries to update data offset when kicking off reshape. If it can't change data offset, it needs to use child_monitor to monitor reshape progress and do back up job. And it needs to update reshape_progress to need_back when reshape finishes. If not, it will be in a infinite loop. Signed-off-by: Xiao Ni --- Grow.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Grow.c b/Grow.c index 97e48d86a33f..6b621aea4ecc 100644 --- a/Grow.c +++ b/Grow.c @@ -4142,8 +4142,7 @@ int progress_reshape(struct mdinfo *info, struct reshape *reshape, * waiting forever on a dead array */ char action[SYSFS_MAX_BUF_SIZE]; - if (sysfs_get_str(info, NULL, "sync_action", action, sizeof(action)) <= 0 || - strncmp(action, "reshape", 7) != 0) + if (sysfs_get_str(info, NULL, "sync_action", action, sizeof(action)) <= 0) break; /* Some kernels reset 'sync_completed' to zero * before setting 'sync_action' to 'idle'. @@ -4151,12 +4150,18 @@ int progress_reshape(struct mdinfo *info, struct reshape *reshape, */ if (completed == 0 && advancing && strncmp(action, "idle", 4) == 0 && - info->reshape_progress > 0) + info->reshape_progress > 0) { + info->reshape_progress = need_backup; break; + } if (completed == 0 && !advancing && strncmp(action, "idle", 4) == 0 && info->reshape_progress < - (info->component_size * reshape->after.data_disks)) + (info->component_size * reshape->after.data_disks)) { + info->reshape_progress = need_backup; + break; + } + if (strncmp(action, "reshape", 7) != 0) break; sysfs_wait(fd, NULL); if (sysfs_fd_get_ll(fd, &completed) < 0) From patchwork Wed Aug 28 02:11: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: 13780299 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 65484199B9 for ; Wed, 28 Aug 2024 02:12:30 +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=1724811152; cv=none; b=cE8xWJScg5dHGSThNUsqkv3yPt4cZnQ08nB9yvWARi8F/SO1vdhXPE/YyGuBklUrGDTei20w8WCIGOrLsMcAOzA3NjBj9mcIFxTKdeDXo2Kn6s7P0Y17RkzGXDEDC34Mkd75rCjxrsNKuLefj09crHUJrz4NHzFrRs3JxqPY/o0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724811152; c=relaxed/simple; bh=QhSYxdhsq3hvM2Nd7sjS3TUsSIhsjWOKWBEziaPJ8i4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PoPKmht6LjI+PQ5zsKBmJBJSydv2npMg1OEJAmMsJZDJoF6BDw+Bf3AjuZvrL6EiRs71MXL2sgFf0ZM1ZaSnc5rIQzf+RdwxYR5oRMQEqkHSfdxf4PkRtap4Mx1zkinWeeKsmEv05jM4gcaiHYnqWqAnY4l0OkBRCWU7hpficsA= 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=BaqDFuEQ; 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="BaqDFuEQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724811149; 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=/HC0VZKh/qNGFi7wtrdTq0IQi5hLwfOqLQKq/H2n9vk=; b=BaqDFuEQ6+P4gij6GOAP7tmI+5OANPtjLY7Etv1Hm+Jsew2Hl4YdzDQjSOUN+FT/Tk9uu0 WfGN9fLmOg2WkQMWfMCode1hAdMF4sG69ERczHZ4P8bBTyDKG5njftzeIa6krnIj8NWgWt eOtsmMuF0DkzWVgAtG0c0gCSxlehSfo= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-541-dpCIfgMzOOWhfHDEZ0gecg-1; Tue, 27 Aug 2024 22:12:26 -0400 X-MC-Unique: dpCIfgMzOOWhfHDEZ0gecg-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EF2FC1955BEE; Wed, 28 Aug 2024 02:12:24 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.24]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8EB8C3002240; Wed, 28 Aug 2024 02:12:20 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: ncroxon@redhat.com, linux-raid@vger.kernel.org Subject: [PATCH 03/10] mdadm/Grow: Can't open raid when running --grow --continue Date: Wed, 28 Aug 2024 10:11:43 +0800 Message-Id: <20240828021150.63240-4-xni@redhat.com> In-Reply-To: <20240828021150.63240-1-xni@redhat.com> References: <20240828021150.63240-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.30.177.4 It passes 'array' as devname in Grow_continue. So it fails to open raid device. Use mdinfo to open raid device. Signed-off-by: Xiao Ni --- Grow.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Grow.c b/Grow.c index 6b621aea4ecc..2a7587315817 100644 --- a/Grow.c +++ b/Grow.c @@ -3688,9 +3688,12 @@ started: set_array_size(st, info, info->text_version); if (info->new_level != reshape.level) { - if (fd < 0) - fd = open(devname, O_RDONLY); - impose_level(fd, info->new_level, devname, verbose); + fd = open_dev(sra->sys_name); + if (fd < 0) { + pr_err("Can't open %s\n", sra->sys_name); + goto out; + } + impose_level(fd, info->new_level, sra->sys_name, verbose); close(fd); if (info->new_level == 0) st->update_tail = NULL; From patchwork Wed Aug 28 02:11: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: 13780300 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 DAD4C199B9 for ; Wed, 28 Aug 2024 02:12:34 +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=1724811156; cv=none; b=CwvFSZ+DmF7tYilYiW6+MtkEocq1lfl1zbFdZcsKMsF2TZ8d6cu5EeBbO4oiqGgOIZJmmKr+90QkQhNunVkCS04inYIhBUid6iVY7r4OU+Nbm38f5Udf+f6a5W6ZaTS53uyA249LuXBY3nX+dpYsszgmicK5gdAnBhpZjqnP1kU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724811156; c=relaxed/simple; bh=UVVjq7cWmRg0LfpYkoOu27ebo4uiZcLN/QzfrcMuRXQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CRhHKIxNjnsHGMLb8YJ7kVpsZBioIMJxAp0zNmN7ZZAbaCqBMxFPvGEcIFygwAgK5TsbEfebzdsphXCC2KlOJtCGAk/w/iTuSAcR+7v6BLIU5+cc0ZSH5UcU6EjQ13JujI0k1cQHWywG/Mfkf4elxKirDVc6+9VQaLqNH7+5TZ4= 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=Dhu0lHvP; 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="Dhu0lHvP" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724811153; 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=4eoPsAnFhicrDpf9RMhK41us47wLQZPSb94/GVUNvqk=; b=Dhu0lHvPTQLJb1Yf/sRQXE6xqubgWPI9Owh8SLzVOzVCOhaCdYMOyCGEHou2bM1VZayoGZ e/ZVxDMN7dPXbTnIFwf80yhzqSwbJzeT4R2wLqd4EqWVU+2r1ZnX3PRuwX4h+ZMYS4u0bp sk6uPj8TxLHHh7DlUhQz3QdPbCfKNu4= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-621-p5q0Tg8qO-KOt5FOLjhlHQ-1; Tue, 27 Aug 2024 22:12:32 -0400 X-MC-Unique: p5q0Tg8qO-KOt5FOLjhlHQ-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 666BA1955BE7; Wed, 28 Aug 2024 02:12:31 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.24]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C01E03001FF9; Wed, 28 Aug 2024 02:12:25 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: ncroxon@redhat.com, linux-raid@vger.kernel.org Subject: [PATCH 04/10] mdadm/Grow: sleep a while after removing disk in impose_level Date: Wed, 28 Aug 2024 10:11:44 +0800 Message-Id: <20240828021150.63240-5-xni@redhat.com> In-Reply-To: <20240828021150.63240-1-xni@redhat.com> References: <20240828021150.63240-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.30.177.4 It needs to remove disks when reshaping from raid456 to raid0. In kernel space it sets MD_RECOVERY_RUNNING. And it will fail to change level. So wait sometime to let md thread to clear this flag. This is found by test case 05r6tor0. Signed-off-by: Xiao Ni --- Grow.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Grow.c b/Grow.c index 2a7587315817..aaf349e9722f 100644 --- a/Grow.c +++ b/Grow.c @@ -3028,6 +3028,12 @@ static int impose_level(int fd, int level, char *devname, int verbose) makedev(disk.major, disk.minor)); hot_remove_disk(fd, makedev(disk.major, disk.minor), 1); } + /* + * hot_remove_disk lets kernel set MD_RECOVERY_RUNNING + * and it can't set level. It needs to wait sometime + * to let md thread to clear the flag. + */ + sleep_for(5, 0, true); } c = map_num(pers, level); if (c) { From patchwork Wed Aug 28 02:11: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: 13780301 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 030C7433A0 for ; Wed, 28 Aug 2024 02:12:38 +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=1724811160; cv=none; b=XJPA0VM+zKFWNhBTuw8OoJ2VoIHwTKrCxzIX8wdpoR2D6cRnWkhfVqLZKLvSRfrIQ04kYHDm9IhJ5eC1GHLl1zd5ginN51kYzGHDiAUxqyqY7dvp+sDKVGk+R05sV8XloZtsiNJ/6K9PsqIY8peO7TN2nYgqYXuRA1pN0UxiNYU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724811160; c=relaxed/simple; bh=q3mdBdhvEPP3XCQSyxUjsSgFizaFpUqhVjHpdv/xslg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=u5Z7ANPYKdy/Ac4J46pA6jPAXpkQYN9WIJT5XSIjidksBOgHECCiknVQaN+xCg4oQMXiGTW/gZsGcG4ZDQHyuf4eEuh+vjusUfS3Pvu7/qxi1Vvr9yaG+Jm9Ia7mLpBO1czpvPv7n6aYCXp/ff68aY8HkK5YrNZM/ssx6SFOw+o= 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=fuB/uDi2; 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="fuB/uDi2" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724811158; 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=a+1VjOfx8xpJDgToWYqTQnaqNxwgZ+emJVaCvXR4SzY=; b=fuB/uDi2+NAvSNaluVITk3Jjg7m9C9yuZeB+1VIBUwDm7utHkk4mgG4I4X5AQh4j/ywEJA AVyOZwiHgbvwLaEMQgL9coFUEiMnFddKgS6FmpipBdE+0ytLGtQN3wyC5CPnGCadrdLGKR YZGQCmzuO5CkNMAhGAUiE5Qydkv3y/U= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-607-tLNErWC3PwS9EWQsI0k8SQ-1; Tue, 27 Aug 2024 22:12:36 -0400 X-MC-Unique: tLNErWC3PwS9EWQsI0k8SQ-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9E66E1955D4C; Wed, 28 Aug 2024 02:12:35 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.24]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9B33C3001FF9; Wed, 28 Aug 2024 02:12:32 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: ncroxon@redhat.com, linux-raid@vger.kernel.org Subject: [PATCH 05/10] mdadm/tests: wait until level changes Date: Wed, 28 Aug 2024 10:11:45 +0800 Message-Id: <20240828021150.63240-6-xni@redhat.com> In-Reply-To: <20240828021150.63240-1-xni@redhat.com> References: <20240828021150.63240-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.30.177.4 check wait waits reshape finishes, but it doesn't wait level changes. The level change happens in a forked child progress. So we need to search the child progress and monitor it. Signed-off-by: Xiao Ni --- tests/05r6tor0 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/05r6tor0 b/tests/05r6tor0 index 2fd51f2ea4bb..b2685b721c2e 100644 --- a/tests/05r6tor0 +++ b/tests/05r6tor0 @@ -13,6 +13,10 @@ check raid5 testdev $md0 3 19456 512 mdadm -G $md0 -l0 check wait; sleep 1 +while ps auxf | grep "mdadm -G" | grep -v grep +do + sleep 1 +done check raid0 testdev $md0 3 19456 512 mdadm -G $md0 -l5 --add $dev3 $dev4 From patchwork Wed Aug 28 02:11: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: 13780302 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 85695199B9 for ; Wed, 28 Aug 2024 02:12:45 +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=1724811167; cv=none; b=VltJTGJ+CRChe8ECtBddZZY5UVg5dI3zvJXbUuv509lmIoPmBXBnsinTQvhkt4MOLG7bvQwt8/6udXcEOVnrieHhZfli9bNkeNHkK7Jljr6cEIzyANTf8EI2+YaG9SCR2xP8XgPySTw8m++wXKBpQnp6nPkCoHSdvV0FVXV13S8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724811167; c=relaxed/simple; bh=NlIXywn103hmbIvNI7t45fJ7x57KZ2xFODYgbsr3fbI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZszKSTVqJJSP2WjdnFUvRo4YMqhrEvDlawO7e7eIUpnDEFv5hiESmP6MQAgjoCIMXxov21pzm+KlZTXBAIAeBxuez/sy/I0T0jTD5c/DX/pPKv3vay9Er4KslCnR4RxR53mRs+3llVwk2WeNrMX+lbB/tr6vhYcUhTUW0rB08Ss= 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=ccgY0sn5; 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="ccgY0sn5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724811164; 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=/ZEBkdeVCLuo/Jd6z7j1RE6T3dAcznWBnGYmgr5DDUo=; b=ccgY0sn53LQHCdYcRclKXH05yrimjwQks5c7KECpD7/iIZvOcf5lNkP6omqDD5gF2+tpsx iMz6x9bvmxjHAvYuBKOiqjdUiOA7huFD4ltfk1i5qNs1lJ4I8J4G9ysS7siR3z1ntRe2R1 pKblWRsNUJwMGH/YNIjqaE2Ree/lFqk= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-693-9J2DHNfYNI6Lm_TO68h4aA-1; Tue, 27 Aug 2024 22:12:41 -0400 X-MC-Unique: 9J2DHNfYNI6Lm_TO68h4aA-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 678911955F65; Wed, 28 Aug 2024 02:12:40 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.24]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 857753001FF9; Wed, 28 Aug 2024 02:12:36 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: ncroxon@redhat.com, linux-raid@vger.kernel.org Subject: [PATCH 06/10] mdadm/tests: 07changelevels fix Date: Wed, 28 Aug 2024 10:11:46 +0800 Message-Id: <20240828021150.63240-7-xni@redhat.com> In-Reply-To: <20240828021150.63240-1-xni@redhat.com> References: <20240828021150.63240-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.30.177.4 There are five changes to this case. 1. remove testdev check. It can't work anymore and check if it's a block device directly. 2. It can't change level and chunk size at the same time 3. Sleep more than 10s before check wait. The test devices are small. Sometimes it can finish so quickly once the reshape just starts. mdadm will be stuck before it waits reshape to start. So the sync speed is limited. And it restores the sync speed when it waits reshape to finish. It's good for case without backup file. It uses systemd service mdadm-grow-continue to monitor reshape progress when specifying backup file. If reshape finishes so quickly before it starts monitoring reshape progress, the daemon will be stuck too. Because reshape_progress is 0 which means the reshape hasn't been started. So give more time to let service can get right information from kernel space. But before getting these information. It needs to suspend array. At the same time the reshape is running. The kernel reshape daemon will update metadata 10s. So it needs to limit the sync speed more than 10s before restoring sync speed. Then systemd service can suspend array and start monitoring reshape progress. 4. Wait until mdadm-grow-continue service exits mdadm --wait doesn't wait systemd service. For the case that needs backup file, systemd service deletes the backup file after reshape finishes. In this test case, it runs next case when reshape finishes. And it fails because it can't create backup file because the backup file exits. 5. Don't reshape from raid5 to raid1. It can't work now. Signed-off-by: Xiao Ni --- tests/07changelevels | 27 ++++++++++++--------------- tests/07changelevels.broken | 9 --------- tests/func.sh | 4 ++++ 3 files changed, 16 insertions(+), 24 deletions(-) delete mode 100644 tests/07changelevels.broken diff --git a/tests/07changelevels b/tests/07changelevels index a328874ac43f..3df8660e6bae 100644 --- a/tests/07changelevels +++ b/tests/07changelevels @@ -10,7 +10,6 @@ export MDADM_GROW_VERIFY=1 dotest() { sleep 2 check wait - testdev $md0 $1 19968 64 nd blockdev --flushbufs $md0 cmp -s -n $[textK*1024] $md0 /tmp/RandFile || { echo cmp failed; exit 2; } # write something new - shift chars 4 space @@ -24,7 +23,7 @@ checkgeo() { # level raid_disks chunk_size layout dev=$1 shift - sleep 0.5 + sleep 15 check wait sleep 1 for attr in level raid_disks chunk_size layout @@ -43,22 +42,25 @@ checkgeo() { bu=/tmp/md-test-backup rm -f $bu -mdadm -CR $md0 -l1 -n2 -x1 $dev0 $dev1 $dev2 -z 19968 -testdev $md0 1 $mdsize1a 64 +mdadm -CR $md0 -l1 -n2 -x1 $dev0 $dev1 $dev2 +[ -b $md0 ] || die "$1 isn't a block device." dd if=/tmp/RandFile of=$md0 dotest 1 -mdadm --grow $md0 -l5 -n3 --chunk 64 +mdadm --grow $md0 -l5 -n3 +checkgeo md0 raid5 3 dotest 2 mdadm $md0 --add $dev3 $dev4 mdadm --grow $md0 -n4 --chunk 32 +checkgeo md0 raid5 4 $[32*1024] dotest 3 mdadm -G $md0 -l6 --backup-file $bu +checkgeo md0 raid6 5 $[32*1024] dotest 3 -mdadm -G /dev/md0 --array-size 39936 +mdadm -G /dev/md0 --array-size 37888 mdadm -G $md0 -n4 --backup-file $bu checkgeo md0 raid6 4 $[32*1024] dotest 2 @@ -67,14 +69,11 @@ mdadm -G $md0 -l5 --backup-file $bu checkgeo md0 raid5 3 $[32*1024] dotest 2 -mdadm -G /dev/md0 --array-size 19968 +mdadm -G /dev/md0 --array-size 18944 mdadm -G $md0 -n2 --backup-file $bu checkgeo md0 raid5 2 $[32*1024] dotest 1 -mdadm -G --level=1 $md0 -dotest 1 - # now repeat that last few steps only with a degraded array. mdadm -S $md0 mdadm -CR $md0 -l6 -n5 $dev0 $dev1 $dev2 $dev3 $dev4 @@ -83,7 +82,7 @@ dotest 3 mdadm $md0 --fail $dev0 -mdadm -G /dev/md0 --array-size 37888 +mdadm -G /dev/md0 --array-size 35840 mdadm -G $md0 -n4 --backup-file $bu dotest 2 checkgeo md0 raid6 4 $[512*1024] @@ -103,12 +102,10 @@ dotest 2 mdadm -G $md0 -l5 --backup-file $bu dotest 2 -mdadm -G /dev/md0 --array-size 18944 +mdadm -G /dev/md0 --array-size 17920 mdadm -G $md0 -n2 --backup-file $bu dotest 1 checkgeo md0 raid5 2 $[512*1024] mdadm $md0 --fail $dev2 -mdadm -G --level=1 $md0 -dotest 1 -checkgeo md0 raid1 2 +mdadm -S $md0 diff --git a/tests/07changelevels.broken b/tests/07changelevels.broken index 9b930d932c48..000000000000 --- a/tests/07changelevels.broken +++ /dev/null @@ -1,9 +0,0 @@ -always fails - -Fails with errors: - - mdadm: /dev/loop0 is smaller than given size. 18976K < 19968K + metadata - mdadm: /dev/loop1 is smaller than given size. 18976K < 19968K + metadata - mdadm: /dev/loop2 is smaller than given size. 18976K < 19968K + metadata - - ERROR: /dev/md0 isn't a block device. diff --git a/tests/func.sh b/tests/func.sh index e7ccc4fc66eb..567d91d9173e 100644 --- a/tests/func.sh +++ b/tests/func.sh @@ -362,6 +362,10 @@ check() { do sleep 0.5 done + while ps auxf | grep "mdadm --grow --continue" | grep -v grep + do + sleep 1 + done echo $min > /proc/sys/dev/raid/speed_limit_min echo $max > /proc/sys/dev/raid/speed_limit_max ;; From patchwork Wed Aug 28 02:11: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: 13780303 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 907B544C86 for ; Wed, 28 Aug 2024 02:12:47 +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=1724811169; cv=none; b=NyTzmFN4D6eLZ++3d5xasrKGNrs5zGt3+iOaeIGrcNW5T8yHVbSNVYeh5tq+E3IXVDU6fxIKBkfmeHUanWu8HfN/ESEZub7HyVxox41/pLoXQqkCmVeyQSAODqXw8iID33XWDFnKZSLhrg/VcDcXO88p7wL1Ro6mNMKKhemdlqs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724811169; c=relaxed/simple; bh=3R5bjZW2k+13MxV8qtgaazliryK+LB595Y/ZnuaZfu0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jAGD3tNI/Sdu8Ci0PfAorE6IoKyH0lVw/xDrZ3KQIn9NRnXU0ZWXkTzREVrJ3a3dGEPMO5+n2hkjXHnsEKDMnTwGWXp36yIHseR+WkpjR+KdG1GdwzotmVlfQcyorG0YhOwb28MI3hL3lc8sJJeJRCIoScao232qr7x0D9BqfUc= 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=a33k1ott; 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="a33k1ott" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724811166; 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=qOjV1DD5nLgIPRR5RHA+HtBbJtXk+/9yuAPgArD0GCU=; b=a33k1otttOUi/phEYqB542UZxYiYHDq//G6bToVmUmu/Lu1ix9ixvdGnWsiJ8g5uv3yLix tPstgh4o/7o6ugJ16YNtmdrH8H3yE6WwAmVTJIPhyk6PiovadJ2iXaBuRNNje4T/GfFMQI J+RdvJtwU8Vkgwm3vy0u5Zpr4+a9ijc= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-473-Ds4Ay8trMOeDmPqJ3LVVrg-1; Tue, 27 Aug 2024 22:12:45 -0400 X-MC-Unique: Ds4Ay8trMOeDmPqJ3LVVrg-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3FA571955D57; Wed, 28 Aug 2024 02:12:44 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.24]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 579FC3001FF9; Wed, 28 Aug 2024 02:12:40 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: ncroxon@redhat.com, linux-raid@vger.kernel.org Subject: [PATCH 07/10] mdadm/tests: Remove 07reshape5intr.broken Date: Wed, 28 Aug 2024 10:11:47 +0800 Message-Id: <20240828021150.63240-8-xni@redhat.com> In-Reply-To: <20240828021150.63240-1-xni@redhat.com> References: <20240828021150.63240-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.30.177.4 07reshape5intr can run successfully now. Signed-off-by: Xiao Ni --- tests/07reshape5intr.broken | 45 ------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 tests/07reshape5intr.broken diff --git a/tests/07reshape5intr.broken b/tests/07reshape5intr.broken index efe52a667172..000000000000 --- a/tests/07reshape5intr.broken +++ /dev/null @@ -1,45 +0,0 @@ -always fails - -This patch, recently added to md-next causes the test to always fail: - -7e6ba434cc60 ("md: don't unregister sync_thread with reconfig_mutex -held") - -The new error is simply: - - ERROR: no reshape happening - -Before the patch, the error seen is below. - --- - -fails infrequently - -Fails roughly 1 in 4 runs with errors: - - mdadm: Merging with already-assembled /dev/md/0 - mdadm: cannot re-read metadata from /dev/loop6 - aborting - - ERROR: no reshape happening - -Also have seen a random deadlock: - - INFO: task mdadm:109702 blocked for more than 30 seconds. - Not tainted 5.18.0-rc3-eid-vmlocalyes-dbg-00095-g3c2b5427979d #2040 - "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. - task:mdadm state:D stack: 0 pid:109702 ppid: 1 flags:0x00004000 - Call Trace: - - __schedule+0x67e/0x13b0 - schedule+0x82/0x110 - mddev_suspend+0x2e1/0x330 - suspend_lo_store+0xbd/0x140 - md_attr_store+0xcb/0x130 - sysfs_kf_write+0x89/0xb0 - kernfs_fop_write_iter+0x202/0x2c0 - new_sync_write+0x222/0x330 - vfs_write+0x3bc/0x4d0 - ksys_write+0xd9/0x180 - __x64_sys_write+0x43/0x50 - do_syscall_64+0x3b/0x90 - entry_SYSCALL_64_after_hwframe+0x44/0xae From patchwork Wed Aug 28 02:11: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: 13780304 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 63D9F44C86 for ; Wed, 28 Aug 2024 02:12: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=1724811172; cv=none; b=b02kDLzcqM7qZPVDU+J5q1OZlq5FFSjhOP3W1Ie/D5AUKHxsE9pw16OkJS+jo/QTJxx3wPNN+0YzSGzqbhp6NGm8SFJ4Wi6VqaUPirBBmQMhlM3xZr9agOc6WywQ1qiZSk1yk13Y/7BJUAFQq8jTXdzix14YjwkSjyfpAgX9+ZE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724811172; c=relaxed/simple; bh=8PqiUkFVBO/ty1x89DfvANMtc9MNw1bLGJfMq5PzzOc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ag+if3EUUQzC/I3GilmdoIvRulH86CJ5xq3Vs6y3WhOgrXTYcszT5zerofFdLkPeTN1i4xElyqa7yr+a0c+2QzHRti5nJwDbGopTBVOykC8tsGxRyhXrYgdpeeSQvtvtZoxIg+qeivGjZVyKf5bV1tBbpw793dTooH30SZLeOoY= 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=I5XDpCIl; 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="I5XDpCIl" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724811170; 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=1hTP7jiUhayaW8uExnNuDO1aX1pMU5eDC1T6UohjVIo=; b=I5XDpCIlXdGZSUheaQUAK6RSb0qUzWLqR1yTTHUxkDCsNAvfnc6GaRsREIidDX9JSrhgBM 61fAFiTFwXNDkeJlt5DEShZ/zlTBpaYB3b6IIFQdJfKfE2ixZu1JpXU6xF2RtGme31xjPV OBYHkQ5/RN3fPPyPmcZtJWE5DvEgFXI= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-187-sEBfEvjAN6qpSR306id-bA-1; Tue, 27 Aug 2024 22:12:49 -0400 X-MC-Unique: sEBfEvjAN6qpSR306id-bA-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 372D11955D48; Wed, 28 Aug 2024 02:12:48 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.24]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 665473002240; Wed, 28 Aug 2024 02:12:44 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: ncroxon@redhat.com, linux-raid@vger.kernel.org Subject: [PATCH 08/10] mdadm/tests: 07testreshape5 fix Date: Wed, 28 Aug 2024 10:11:48 +0800 Message-Id: <20240828021150.63240-9-xni@redhat.com> In-Reply-To: <20240828021150.63240-1-xni@redhat.com> References: <20240828021150.63240-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.30.177.4 Init dir to avoid test failure. Signed-off-by: Xiao Ni --- tests/07testreshape5 | 1 + tests/07testreshape5.broken | 12 ------------ 2 files changed, 1 insertion(+), 12 deletions(-) delete mode 100644 tests/07testreshape5.broken diff --git a/tests/07testreshape5 b/tests/07testreshape5 index 0e1f25f98bc8..d90fd15e0e61 100644 --- a/tests/07testreshape5 +++ b/tests/07testreshape5 @@ -4,6 +4,7 @@ # kernel md code to move data into and out of variously # shaped md arrays. set -x +dir="." layouts=(la ra ls rs) for level in 5 6 do diff --git a/tests/07testreshape5.broken b/tests/07testreshape5.broken index a8ce03e491b3..000000000000 --- a/tests/07testreshape5.broken +++ /dev/null @@ -1,12 +0,0 @@ -always fails - -Test seems to run 'test_stripe' at $dir directory, but $dir is never -set. If $dir is adjusted to $PWD, the test still fails with: - - mdadm: /dev/loop2 is not suitable for this array. - mdadm: create aborted - ++ return 1 - ++ cmp -s -n 8192 /dev/md0 /tmp/RandFile - ++ echo cmp failed - cmp failed - ++ exit 2 From patchwork Wed Aug 28 02:11: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: 13780305 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 BB8EF45C1C for ; Wed, 28 Aug 2024 02:12:56 +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=1724811178; cv=none; b=irS/L0j8MF2I5r7GAXFkk6v5aoPoJH1pvMO7tUTIkJb3F7+qlepnHJXlnaSSdj3GV3iKaWGhG+ij6+nvr9Tj7xnmHXWlGkgregsl10rbYgWVyE+7BbjVBrH3Ghp1e04du5cSOZzl1bB6CA0Jb+aWyOazYFaJ/HKuL2kDhtGXM7w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724811178; c=relaxed/simple; bh=vKFkNuEedEjjKQPRKZIOznDQ6HPCvciNpWM/fv8O0lE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Z5/1+g21uY+6EW9rPlxer17gIen/I9gOmPkNYq2OjdsCnn6UCKP+DZwjx5IusxS3eg7jNz2OdAHYxoZHLDnp326X/Ui83SupnnEkTL6TGzctzEFMqpoXCQ6KrraPo3gJTMGcjjZXWhXTHIpiBZvJzEoZww4j7AVya33yqrTZ7lI= 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=gKPwvCJ1; 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="gKPwvCJ1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724811175; 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=wO51OinyxmL8YM6r78uSv88XCuoLuUrLG9NsHQWm1ZM=; b=gKPwvCJ1GXdyidhsLARs+FvZyW8oN+Fdbv1w40Msseajrx71vZ00ETm5hpZEGS3tTEFJl/ DuLv/bgb8voXs6SHuZtFVDAukIQ4aTyCaBriQyKUXWETtBJIPz4KlFI8dqaxC5LMey5tbf ij6O9it7yLUAHvLJhcqdRbLYnEnVbxI= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-134--rErXOyaPF6-4EK4-KzOig-1; Tue, 27 Aug 2024 22:12:54 -0400 X-MC-Unique: -rErXOyaPF6-4EK4-KzOig-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4CABD1955F3D; Wed, 28 Aug 2024 02:12:53 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.24]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 28DF03001FF9; Wed, 28 Aug 2024 02:12:48 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: ncroxon@redhat.com, linux-raid@vger.kernel.org Subject: [PATCH 09/10] mdadm/tests: remove 09imsm-assemble.broken Date: Wed, 28 Aug 2024 10:11:49 +0800 Message-Id: <20240828021150.63240-10-xni@redhat.com> In-Reply-To: <20240828021150.63240-1-xni@redhat.com> References: <20240828021150.63240-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.30.177.4 09imsm-assemble can run successfully. Signed-off-by: Xiao Ni --- tests/09imsm-assemble.broken | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 tests/09imsm-assemble.broken diff --git a/tests/09imsm-assemble.broken b/tests/09imsm-assemble.broken index a6d4d5cf911b..000000000000 --- a/tests/09imsm-assemble.broken +++ /dev/null @@ -1,6 +0,0 @@ -fails infrequently - -Fails roughly 1 in 10 runs with errors: - - mdadm: /dev/loop2 is still in use, cannot remove. - /dev/loop2 removal from /dev/md/container should have succeeded From patchwork Wed Aug 28 02:11: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: 13780306 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 7926D199B9 for ; Wed, 28 Aug 2024 02:13:03 +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=1724811184; cv=none; b=p23c7aFJYl5YlrwV07iLVZZAYbsf1sU3H+T99Grp+1J7m7ZSxA1o4QkSxQunhtKxA9aW2LFz5DWsfyJrvdMdy+91wPfYb/q2pURBz2dkSotcZ7XlAIgukODIjmiL9YuNkolekaKe+1LMHTaDTfX5yE7epV4KtdLbQcKxjfGoR0c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724811184; c=relaxed/simple; bh=igfVsssIvRAX/6DmDpKDYJ/OAv6zpJBv4CpmVx5nCvw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XGU1M6NOCNDbL+kne1PMsl2S1YjyCaNBuqgJA2mHsyDTD/D9TvfKDuuG+2fB0eT9boMa0wq5KfgUL6xdjjO4ci8/Esv+nulNNBUzQIQvkZoQ5GpL/I/F+ga8quL9jn0Bf3hQC9duhbs8ViCw2dRP8FMR04upDYt/BeYl+gCs6CM= 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=jT6Az7Xl; 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="jT6Az7Xl" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724811182; 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=wWH5gDud2ndQLIPMQhg3f5hHUoHebPVMFZppoap6NHw=; b=jT6Az7XlwSWT4/ADO1JVgdH+hEspfT8nz27kQDx1jXWa6rjJGmvldGF+/55dq9bVNY+k4B /vIS3xcwZyJsH5+GJyPZxGyzWYjOudpGd3+eU3GpcsRyTdDwOMcpfC21f0uSJO7D9WCheB Osyenv1z9PNd0qfOe+jambtdbNQEvPU= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-540-8ugTrjfZMqiB6aMDO47aPw-1; Tue, 27 Aug 2024 22:12:58 -0400 X-MC-Unique: 8ugTrjfZMqiB6aMDO47aPw-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0A2271955F3B; Wed, 28 Aug 2024 02:12:58 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.120.24]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 188533001FF9; Wed, 28 Aug 2024 02:12:53 +0000 (UTC) From: Xiao Ni To: mariusz.tkaczyk@linux.intel.com Cc: ncroxon@redhat.com, linux-raid@vger.kernel.org Subject: [PATCH 10/10] mdadm/Manage: record errno Date: Wed, 28 Aug 2024 10:11:50 +0800 Message-Id: <20240828021150.63240-11-xni@redhat.com> In-Reply-To: <20240828021150.63240-1-xni@redhat.com> References: <20240828021150.63240-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.30.177.4 Sometimes it reports: mdadm: failed to stop array /dev/md0: Success It's the reason the errno is reset. So record errno during the loop. Signed-off-by: Xiao Ni --- Manage.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Manage.c b/Manage.c index 241de05520d6..aba97df8e122 100644 --- a/Manage.c +++ b/Manage.c @@ -238,13 +238,14 @@ int Manage_stop(char *devname, int fd, int verbose, int will_retry) "array_state", "inactive")) < 0 && errno == EBUSY) { + err = errno; sleep_for(0, MSEC_TO_NSEC(200), true); count--; } if (err) { if (verbose >= 0) pr_err("failed to stop array %s: %s\n", - devname, strerror(errno)); + devname, strerror(err)); rv = 1; goto out; } @@ -438,14 +439,15 @@ done: count = 25; err = 0; while (count && fd >= 0 && (err = ioctl(fd, STOP_ARRAY, NULL)) < 0 && errno == EBUSY) { + err = errno; sleep_for(0, MSEC_TO_NSEC(200), true); count --; } if (fd >= 0 && err) { if (verbose >= 0) { pr_err("failed to stop array %s: %s\n", - devname, strerror(errno)); - if (errno == EBUSY) + devname, strerror(err)); + if (err == EBUSY) cont_err("Perhaps a running process, mounted filesystem or active volume group?\n"); } rv = 1;