Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp4564625pxt; Wed, 11 Aug 2021 08:48:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymrm++Vriweki1ASYiQIAEk7fSAcjol8Lcv0tFOyTfluQ9MB1ZCMIlSVQod96KSB5f45+w X-Received: by 2002:adf:f68d:: with SMTP id v13mr19630929wrp.358.1628696894913; Wed, 11 Aug 2021 08:48:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628696894; cv=none; d=google.com; s=arc-20160816; b=qf2IawLVUQ1NFT5Vj/MzJlS8OfhIemcKMMulGaY4SmQkUjeupyR4Sto2uDU0qRpycd 4PIMZoNPErS2b00wpizhiktwXwtJbwN92lokUmC3e1fXlHreCh1O70JSWbQmgUFkSHCa 5h8c/MACx9c/tvbXDS2Cfq4csJ5TGCirKZkwWqgFGfjjIFuh8SxINLD+0gAyAOQ5Be/L Cy2nYE1VporRHNx/mqlacbu0zSYqhO+ACl8OSTGX/VlyVjPhmF92QkIAph9fVbeOL8Tb Tw86L55DdyaHy28/uNZ9CIY6NdkysIlLBMli73wcDjW8nplH5yFeuDYZAxjUQy/bGemm zDMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=F1cdFO/HMSW74Xo13hr750mIwMV4fTBWscYd6QDc6Wk=; b=dUzMctmIesq6uOw63Bm05tPmwSj3lhnQPGF9sBfZO0EoZFcSskdxG7z9Rk61/btZr8 MSbGG3aglWgGGDXE3+KGE36+AdwzZq8eB6dXmWUhjOBLHBFxrsY1EnJc0yzhvuAYFPQo 2xnKzfuwAhGosOCR/O2avckkC4Dtie6k0odvZ2oDISyhW6U60drTv0Je26B9ur0vqQlX amOxt4hK9a7S3CK7W1EuXvE+Pc0KUQBMxl6d9RTA7otDyJWS2jaNJHnx1BsFK86INEL/ dOwdcpykSvf0KLx0Was1EMF3Osus7+vW98ZFlB7QAnZH4Q5htDyUYNXou3HSCEg70wPN CcYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=N0lS0Jdk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v25si6485004wml.54.2021.08.11.08.47.49; Wed, 11 Aug 2021 08:48:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=N0lS0Jdk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233434AbhHKPpp (ORCPT + 99 others); Wed, 11 Aug 2021 11:45:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233305AbhHKPpk (ORCPT ); Wed, 11 Aug 2021 11:45:40 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC6B2C061765; Wed, 11 Aug 2021 08:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=F1cdFO/HMSW74Xo13hr750mIwMV4fTBWscYd6QDc6Wk=; b=N0lS0JdkdfmAUKeyb2H2fKXl3M vS4T/a9t9ZHecmyulCwJJjBxxIzpzNV7wCRxZfk9ksL/IZC8hAfSCCaQn+I0U7WJeRfWdyqndpnj8 WmqnWYPeNVVIWWXwdrhRTRN+Tc9ovgd90YYDbdydQaZvreaMENd/0BxPOAHCqD9usyOdcyJyJeBPu QyfB+EjAgRs/erSuU1612WWBveITilSzCxcW2aqxoYQt5l9LGVzg5fhMv1Lkb1w9zPaOubWq0CRQA /gNYXHV4hOtvtQ7lffOuI3hi6zuwPvBSisS/4x+5E1IVlZQBYAqnNGDfTuaE+no9so6cKZyzpm7Go 7ytQNCZg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDqPr-007bpG-3W; Wed, 11 Aug 2021 15:45:15 +0000 From: Luis Chamberlain To: fstests@vger.kernel.org Cc: hare@suse.de, dgilbert@interlog.com, jeyu@kernel.org, lucas.demarchi@intel.com, linux-kernel@vger.kernel.org, Luis Chamberlain Subject: [PATCH v2 1/3] fstests: use udevadm settle after pvremove Date: Wed, 11 Aug 2021 08:45:10 -0700 Message-Id: <20210811154512.1813622-2-mcgrof@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210811154512.1813622-1-mcgrof@kernel.org> References: <20210811154512.1813622-1-mcgrof@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As with creation, we also need to use udevadm settle when removing a pv, otherwise we can trip on races with module removals for the block devices in use. This reduces the amount of time in which a block device module refcnt for test modules such as scsi_debug spends outside of 0. Races with the refcnt being greater than 0 means module removal can fail causing false positives. This helps ensure that the pv is really long gone. These issues are tracked for scsi_debug [0] and later found to be a generic issue regardless of filesystem with pvremove [1]. Using udevadm settle *helps*, it does not address all possible races with the refcnt as noted in the generic bug entry [1]. [0] https://bugzilla.kernel.org/show_bug.cgi?id=212337 [1] https://bugzilla.kernel.org/show_bug.cgi?id=214015 Signed-off-by: Luis Chamberlain --- tests/generic/081 | 5 ++++- tests/generic/108 | 1 + tests/generic/459 | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/generic/081 b/tests/generic/081 index f795b2c1..8e552074 100755 --- a/tests/generic/081 +++ b/tests/generic/081 @@ -12,6 +12,7 @@ _begin_fstest auto quick # Override the default cleanup function. _cleanup() { + local pv_ret cd / rm -f $tmp.* @@ -34,7 +35,9 @@ _cleanup() $UMOUNT_PROG $mnt >> $seqres.full 2>&1 $LVM_PROG vgremove -f $vgname >>$seqres.full 2>&1 $LVM_PROG pvremove -f $SCRATCH_DEV >>$seqres.full 2>&1 - test $? -eq 0 && break + pv_ret=$? + $UDEV_SETTLE_PROG + test $pv_ret -eq 0 && break sleep 2 done } diff --git a/tests/generic/108 b/tests/generic/108 index 7dd426c1..b7797e8f 100755 --- a/tests/generic/108 +++ b/tests/generic/108 @@ -21,6 +21,7 @@ _cleanup() $UMOUNT_PROG $SCRATCH_MNT >>$seqres.full 2>&1 $LVM_PROG vgremove -f $vgname >>$seqres.full 2>&1 $LVM_PROG pvremove -f $SCRATCH_DEV $SCSI_DEBUG_DEV >>$seqres.full 2>&1 + $UDEV_SETTLE_PROG _put_scsi_debug_dev rm -f $tmp.* } diff --git a/tests/generic/459 b/tests/generic/459 index e5e5e9ab..5b44e245 100755 --- a/tests/generic/459 +++ b/tests/generic/459 @@ -29,6 +29,7 @@ _cleanup() $UMOUNT_PROG $SCRATCH_MNT >>$seqres.full 2>&1 $LVM_PROG vgremove -ff $vgname >>$seqres.full 2>&1 $LVM_PROG pvremove -ff $SCRATCH_DEV >>$seqres.full 2>&1 + $UDEV_SETTLE_PROG } # Import common functions. -- 2.30.2