From patchwork Fri Jan 12 05:08:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13517949 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 CFFE75B5BA; Fri, 12 Jan 2024 05:08:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="JO+sK6q5" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=k0B9sn9hjq/CgZvN1VkFrZOIPC3AhxaxewALf812BpA=; b=JO+sK6q5MKjRoHsGDXCFT2UlKX 1T48FuIYtb6LHIx7MSUNjvxUNKF15G4nzLccZdU1J5dHOwJuecNG2hZ2gNCasT0vF8ZOWpwPNbyhD 21DN1QRBJBQKb9L61cQRzu89EsSUF1QY+nHe98JRelcSef41gxK/eEsqn+0Mb/HI0Q89ms30Gxpz8 VEXiHOvCjWtLzvTqB5+FCzyKxXhi12on+WKBb0I+M9EE2X7LC3dDRucJfyXsIjEA5mYsr6ybNeKN5 8d5lvR99lwwxaadGwv1PwvFS0GU0bChf1upJc9dcka2BF03/vVvARj6Fkw7R/+FysJVO/N35V+4f3 5bxGk5hw==; Received: from [2001:4bb8:191:2f6b:85c6:d242:5819:3c29] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1rO9mZ-001uje-2T; Fri, 12 Jan 2024 05:08:40 +0000 From: Christoph Hellwig To: zlang@redhat.com Cc: djwong@kernel.org, fstests@vger.kernel.org, linux-xfs@vger.kernel.org Subject: [PATCH 1/4] xfs: check that the mountpoint is actually mounted in _supports_xfs_scrub Date: Fri, 12 Jan 2024 06:08:30 +0100 Message-Id: <20240112050833.2255899-2-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240112050833.2255899-1-hch@lst.de> References: <20240112050833.2255899-1-hch@lst.de> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Add a sanity check that the passed in mount point is actually mounted to guard against actually calling _supports_xfs_scrub before $SCRATCH_MNT is mounted. Signed-off-by: Christoph Hellwig Reviewed-by: Zorro Lang Reviewed-by: Darrick J. Wong --- common/xfs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/xfs b/common/xfs index f53b33fc5..4e54d75cc 100644 --- a/common/xfs +++ b/common/xfs @@ -649,6 +649,9 @@ _supports_xfs_scrub() test "$FSTYP" = "xfs" || return 1 test -x "$XFS_SCRUB_PROG" || return 1 + mountpoint $mountpoint >/dev/null || \ + _fail "$mountpoint is not mounted" + # Probe for kernel support... $XFS_IO_PROG -c 'help scrub' 2>&1 | grep -q 'types are:.*probe' || return 1 $XFS_IO_PROG -c "scrub probe" "$mountpoint" 2>&1 | grep -q "Inappropriate ioctl" && return 1 From patchwork Fri Jan 12 05:08:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13517950 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 470105B5BA; Fri, 12 Jan 2024 05:08:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="cvv4OYMH" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=Sl03jraDijAyirDppxBWSZX/EJI59tIQcDM6nOkTED0=; b=cvv4OYMHArC3GNsEehjI4nGPGH I1oPOL1Pz7o8TJo1qBOEVJjoUSjunlS3wqc5bXuDCD00IGpmeezuFsOtk5L23XSQtn93VwmOYGzdv qmYeJ/imCSJXpKKElHljO7uqj+3AntS4YS3btbpizTbo37YXaxGCD0ykxYcHD2EaBNmEjSbyhGDrJ F3CLvx/dnglCV/3rJM4xP0ZYGzIs8i1T/PN+xKDTiLj25aXfFdG/ayEOGBnmc4FR+dRYnJGFF0DND nXS4RmSyfrmCJlRYu+f+yzJqO1WQM/sLkt5q76iyeXRDNR/tWDLlDH2+GoDFqT1pk5Hg5cyobpIZb 9SpZT2pA==; Received: from [2001:4bb8:191:2f6b:85c6:d242:5819:3c29] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1rO9mc-001ujk-0j; Fri, 12 Jan 2024 05:08:42 +0000 From: Christoph Hellwig To: zlang@redhat.com Cc: djwong@kernel.org, fstests@vger.kernel.org, linux-xfs@vger.kernel.org Subject: [PATCH 2/4] xfs: add a _scratch_require_xfs_scrub helper Date: Fri, 12 Jan 2024 06:08:31 +0100 Message-Id: <20240112050833.2255899-3-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240112050833.2255899-1-hch@lst.de> References: <20240112050833.2255899-1-hch@lst.de> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Add a helper to call _supports_xfs_scrub with $SCRATCH_MNT and $SCRATCH_DEV. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- common/xfs | 7 +++++++ tests/xfs/556 | 2 +- tests/xfs/716 | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/common/xfs b/common/xfs index 4e54d75cc..b71ba8d1e 100644 --- a/common/xfs +++ b/common/xfs @@ -662,6 +662,13 @@ _supports_xfs_scrub() return 0 } +# Does the scratch file system support scrub? +_scratch_require_xfs_scrub() +{ + _supports_xfs_scrub $SCRATCH_MNT $SCRATCH_DEV || \ + _notrun "Scrub not supported" +} + # Save a snapshot of a corrupt xfs filesystem for later debugging. _xfs_metadump() { local metadump="$1" diff --git a/tests/xfs/556 b/tests/xfs/556 index 061d8d572..6be993273 100755 --- a/tests/xfs/556 +++ b/tests/xfs/556 @@ -40,7 +40,7 @@ _scratch_mkfs >> $seqres.full _dmerror_init _dmerror_mount >> $seqres.full 2>&1 -_supports_xfs_scrub $SCRATCH_MNT $SCRATCH_DEV || _notrun "Scrub not supported" +_scratch_require_xfs_scrub # Write a file with 4 file blocks worth of data victim=$SCRATCH_MNT/a diff --git a/tests/xfs/716 b/tests/xfs/716 index 930a0ecbb..4cfb27f18 100755 --- a/tests/xfs/716 +++ b/tests/xfs/716 @@ -31,7 +31,7 @@ _require_test_program "punch-alternating" _scratch_mkfs > $tmp.mkfs _scratch_mount -_supports_xfs_scrub $SCRATCH_MNT $SCRATCH_DEV || _notrun "Scrub not supported" +_scratch_require_xfs_scrub # Force data device extents so that we can create a file with the exact bmbt # that we need regardless of rt configuration. From patchwork Fri Jan 12 05:08:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13517951 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 09C545B5BA; Fri, 12 Jan 2024 05:08:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Wn68BemF" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=MMsxL+lG0fd4vltJu5jNvm/dso6+vr/5nljjlH4LhFk=; b=Wn68BemF0lWzmoTU7DAn6A2Fka HUM6y3ROIaUwwFrqm/gLzVPLfsJbOOZPKOoKXJ5ob82E+iTaIG2MQruXDUyV7F8/UPu/CPrvTig1J ije107EqJYHwNabalC/gLWH36dl1vYmCazYsE0UlXs7mNWcTNtdX7hA2/kZzUC6nUAhv2ghy8ew0Q C7HXJJN4iGxB3SW5ED+TEJmTogTeJqyoz+8ZtODf82JDNaclXeZe7DsRR57zYNX6stPWAFXXa0v1S C3uVrwKoUjg6+hnv5s4VJFFztM9gA7r7tWhVmuZ5zg0TQdIJ8RCEUckiT0ZA/9G4LXuk+OpZkAlWe qi+PM3yg==; Received: from [2001:4bb8:191:2f6b:85c6:d242:5819:3c29] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1rO9me-001uju-2Q; Fri, 12 Jan 2024 05:08:45 +0000 From: Christoph Hellwig To: zlang@redhat.com Cc: djwong@kernel.org, fstests@vger.kernel.org, linux-xfs@vger.kernel.org Subject: [PATCH 3/4] xfs/262: call _scratch_require_xfs_scrub Date: Fri, 12 Jan 2024 06:08:32 +0100 Message-Id: <20240112050833.2255899-4-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240112050833.2255899-1-hch@lst.de> References: <20240112050833.2255899-1-hch@lst.de> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Call _scratch_require_xfs_scrub so that the test is _notrun on kernels without online scrub support. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- tests/xfs/262 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/xfs/262 b/tests/xfs/262 index b28a6c88b..0d1fd779d 100755 --- a/tests/xfs/262 +++ b/tests/xfs/262 @@ -29,6 +29,9 @@ _require_xfs_io_error_injection "force_repair" echo "Format and populate" _scratch_mkfs > "$seqres.full" 2>&1 _scratch_mount + +_scratch_require_xfs_scrub + cp $XFS_SCRUB_PROG $SCRATCH_MNT/xfs_scrub $LDD_PROG $XFS_SCRUB_PROG | sed -e '/\//!d;/linux-gate/d;/=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/};s/[[:blank:]]*\([^[:blank:]]*\) (.*)/\1/' | while read lib; do cp $lib $SCRATCH_MNT/ From patchwork Fri Jan 12 05:08:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13517952 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 2CC4E5B5BD; Fri, 12 Jan 2024 05:08:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="cEDaoDEf" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=+FJ5dChg4aaYW1holosb+rE8x7KgAbLfS0EMDgSKfEQ=; b=cEDaoDEfs7d6UcbmbZSeO1hDA9 yKal7AgF0ELr4s73hb3BKuMgGoqFF1GPur9Qg2ROQGzyWAN90Ut4W1yDV9bfXxWG+b51u4/UDcAkV kJdZvib8lNds6FN+FHhyq9EFdiT8mDKHJwE/qsUntuh7ykrjjlFl55wDKC6A80LlSUau81u97RPtR RH/C0oFRzxZc2Dwx7AgOU7lvwd/Ars1MiKvh4hrsOFBDvKoMT2QNlChU9Nwy5nrZZrKori+CyAjR6 fpXbMzeEyFkBQMCdiRqWvLeb3o8q2b4KTiP5Uf6PdommRtSBLOXC/dbDscTaa2qea7SyVYW5FnD/X SG4PqBYg==; Received: from [2001:4bb8:191:2f6b:85c6:d242:5819:3c29] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1rO9mh-001uk4-0f; Fri, 12 Jan 2024 05:08:47 +0000 From: Christoph Hellwig To: zlang@redhat.com Cc: djwong@kernel.org, fstests@vger.kernel.org, linux-xfs@vger.kernel.org Subject: [PATCH 4/4] xfs/506: call _scratch_require_xfs_scrub Date: Fri, 12 Jan 2024 06:08:33 +0100 Message-Id: <20240112050833.2255899-5-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240112050833.2255899-1-hch@lst.de> References: <20240112050833.2255899-1-hch@lst.de> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Call _scratch_require_xfs_scrub so that the test is _notrun on kernels without online scrub support. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- tests/xfs/506 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/xfs/506 b/tests/xfs/506 index 157dac293..b6ef484a5 100755 --- a/tests/xfs/506 +++ b/tests/xfs/506 @@ -21,6 +21,9 @@ _require_xfs_spaceman_command "health" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount + +_scratch_require_xfs_scrub + _scratch_cycle_mount # make sure we haven't run quotacheck on this mount # Haven't checked anything, it should tell us to run scrub