From patchwork Wed Mar 27 02:43:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13605503 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8B637219EB; Wed, 27 Mar 2024 02:43:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711507405; cv=none; b=elhhR3HKOd1QoZB8DiWrSLbmd9D92oLIYMwIOe9sz5GNzZodWN/k+swTvnyUYr2aktl4CgDmrs+Yp77LgnwM+xANCmyqIu+MxsYbc5iMmQIsBdw5LE9MdnCia5W66yL5P5ImEc8P+9CpwL5qqyJXLXE9+pvcc4vFwHGYsBUlHvo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711507405; c=relaxed/simple; bh=T3dKSwqElnakxlYmwDMfkEVe24cI1fevAxckdQV0WyM=; h=Subject:From:To:Cc:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=M9oHppn8vztFHtHFRLA/xHsD36ETfbETRby/jaimd8eHwXUq/+dB+CRGdlo3cd0y9U8+UOGCbPxAUl038PZMPFsHMfW83UpoKvMgrnIghjFdwdomfPFsz1yzQGQGodmmR9CiNm7cnlhGLFYAeK9xEEKhlYuSHjuwoG0LiFXMndI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TTcr/Ef8; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TTcr/Ef8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17031C433C7; Wed, 27 Mar 2024 02:43:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711507405; bh=T3dKSwqElnakxlYmwDMfkEVe24cI1fevAxckdQV0WyM=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=TTcr/Ef8/xZXFWGDPITP4j+cwz0crnZBNcCFLlM0P+0l64sFCgZdRVQHFwHJzrcaP sDsqgq6opwAoAZZiTqpjocQ3kdB0Xw1IakEpgCFM0byIjB9qrMCnxQbsmKVznc0Pks 3Sv/HzCFHZ2oengqAvcEd51Z4PlRkrSrhzydan9x5SPowub6cCMmVCxsOr7ghpCNu2 mZVjCC8iNoywOoYh57mXYLabV3ib8Pby/kMYk1XndBxBO72YUnkvAoXdcQziWAltVv soA12t4IJrWXzV1hesa1UtEEEEtqBlyuudb6ggBL8t6cAKMtBTe+rACHnO0SrzQ3dA jPzFdhCAOrdvg== Subject: [PATCH 1/4] xfs/270: fix rocompat regex From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: fstests@vger.kernel.org, linux-xfs@vger.kernel.org, guan@eryu.me Date: Tue, 26 Mar 2024 19:43:23 -0700 Message-ID: <171150740360.3286541.8931841089205728326.stgit@frogsfrogsfrogs> In-Reply-To: <171150739778.3286541.16038231600708193472.stgit@frogsfrogsfrogs> References: <171150739778.3286541.16038231600708193472.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong This test fails with the fsverity patchset because the rocompat feature bit for verity is 0x10. The regular expression used to check if the output is hexadecimal requires a single-digit answer, which is no longer the case. Fixes: 5bb78c56ef ("xfs/270: Fix ro mount failure when nrext64 option is enabled") Signed-off-by: Darrick J. Wong --- tests/xfs/270 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/xfs/270 b/tests/xfs/270 index 4e4f767dc1..16e508035a 100755 --- a/tests/xfs/270 +++ b/tests/xfs/270 @@ -30,8 +30,9 @@ _require_scratch_shutdown # change this case. set_bad_rocompat() { ro_compat=$(_scratch_xfs_get_metadata_field "features_ro_compat" "sb 0") - echo $ro_compat | grep -q -E '^0x[[:xdigit:]]$' + echo $ro_compat | grep -q -E '^0x[[:xdigit:]]+$' if [[ $? != 0 ]]; then + echo ":$ro_compat:" echo "features_ro_compat has an invalid value." return 1 fi From patchwork Wed Mar 27 02:43:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13605504 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 332CA21101; Wed, 27 Mar 2024 02:43:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711507411; cv=none; b=K4bnMdp6j0lru7YnG0qMv0zKYD8Nm9pOddQOzy4cGi1h2B4KXoQsPX8GRgSGtcFQ++iDffB2N/TcxUxE7kW40/9boWfTb/pzFd+VAWiWOiVvdFjPb3rRV/GV8hZSKiTB0rMgetagXHWPkEU92rPIpRKZknwM2vNJa5oCdOpordA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711507411; c=relaxed/simple; bh=zh+hQx0zNK6lt/xfZu/rv0SxyEJHegiH5ipJTeXXtb4=; h=Subject:From:To:Cc:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gx9ZaKySN8hcRgu+KtPPkmF+LgSmsiun11OtChPxYBDd7n0m9GghFvRxNe8sUlrF63JTrnkl+V3w6Plf3A5uKwJuFRMP+6ZVVnm5BLAg6YvfmTO+rZ6oo9EK0t9NpY2sQRHBXqXNTBuIJfBTmOVr05Mt/P7I7wLW2tcmMpaKXMA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EcEWhOQe; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EcEWhOQe" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1C56C433C7; Wed, 27 Mar 2024 02:43:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711507410; bh=zh+hQx0zNK6lt/xfZu/rv0SxyEJHegiH5ipJTeXXtb4=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=EcEWhOQe0YfgcLh3jwJ5GmOtUcFTMX/2AaN3PFPyyyOZJFspBBTnDNg89fpnI430S GWA+IaU9y7X3y1M8lXRi8s0QuZqsvXRxKte6okqOlwzUa1IpTh1QMzcLgsR4WtwS2Q dGkEbeyGZrF109/O2ihfOHPTI9GctZTW0PByBpVAjtESj4cXvRnsEnv8Q5JCUpIGfS AjMSCqYslMeJQQFhKDqAMtLsE94KGQvE/lg5ZzyEL007ccgEuDCVWcsd+5UFDOqiwV 3q8/2KAA85rQvSXKU10BRmdEQgik+EPCXLVaijmRGg4JQTrYHWPuiOq21sbc+PfWjh NAtyNVFDudbNQ== Subject: [PATCH 2/4] xfs/176: fix stupid failure From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: fstests@vger.kernel.org, linux-xfs@vger.kernel.org, guan@eryu.me Date: Tue, 26 Mar 2024 19:43:30 -0700 Message-ID: <171150741023.3286541.16393057569793003518.stgit@frogsfrogsfrogs> In-Reply-To: <171150739778.3286541.16038231600708193472.stgit@frogsfrogsfrogs> References: <171150739778.3286541.16038231600708193472.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong Create the $SCRATCH_MNT/urk directory before we fill the filesystem so that its creation won't fail and result in find spraying ENOENT errors all over the golden output. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- tests/xfs/176 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/xfs/176 b/tests/xfs/176 index 5231b888ba..49f7492c03 100755 --- a/tests/xfs/176 +++ b/tests/xfs/176 @@ -51,7 +51,7 @@ _scratch_mount _xfs_force_bdev data $SCRATCH_MNT old_dblocks=$($XFS_IO_PROG -c 'statfs' $SCRATCH_MNT | grep geom.datablocks) -mkdir $SCRATCH_MNT/save/ +mkdir $SCRATCH_MNT/save/ $SCRATCH_MNT/urk/ sino=$(stat -c '%i' $SCRATCH_MNT/save) _consume_freesp() From patchwork Wed Mar 27 02:43:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13605505 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 F37A3219FC; Wed, 27 Mar 2024 02:43:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711507417; cv=none; b=i/qC9lA9oCZR2knrcFD0ykxmF9vZb52QosujU8IL1NM41Cj0FT0a1D7BXjYdU2D7PV2EmINC3sHCI87gyN3M6viN+JU8Ax02QFFxk03HW45wr2bSsyHwuXdEWGGeQ85KIJKEA5SsNFSmZGQ3CV1UKvO1dIkCaZeODg8KRk9SMxg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711507417; c=relaxed/simple; bh=dbWgujssVHgH1plok4cUwbq4GEPCjRB748g910qdHQs=; h=Subject:From:To:Cc:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rBocbH6pFjjpmlfXjTxA1MZGqPSPy4B8G5c3uWq7aTOkZA8chJ1S8G1FPIUShwzeuvqCjXGmztvB4E9yBM62KW4dmjFZJ/OrUvchHVcrfwbvONKLLUFp+cwTmsarp2qh976sWRQgrynCLuNwn2d3x44mp9fSk7qYTUDrk7TC0TM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YV7dsL5C; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YV7dsL5C" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A5D5C433C7; Wed, 27 Mar 2024 02:43:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711507416; bh=dbWgujssVHgH1plok4cUwbq4GEPCjRB748g910qdHQs=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=YV7dsL5CAslSGAAqUB6FTbH1KjvnSgYHwCAidL7FWV2aU4GoMOn9Vtg8Hx9YmQUhV D2UwRlfiMtSd9aRx6dO3I/671tlLn7BBfW5JvICGrqThGoqk6wrnMaEDzpW0BnVQf5 +6b2hiMAcpxWO9AKkHJuSnf1ONGy9tmUZo75hcWv4QcJfq4/hGJpp3j4pIPpbTI0Hv RyBJcYIosR+1cOOxYzxDtQ998w3N8lhJxLlEg3fGEj8F/etCkMmSAXn13vef0ZeXiB OMQlCo3LJZjaciVxwVeXK7Z4VBjr00CaYnbFK3IIg5eeFfPD8nrCLHkozT/YgHfaSp vYMlI/woNBAjg== Subject: [PATCH 3/4] generic/{166,167,333,334,671}: actually fill the filesystem with snapshots From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: fstests@vger.kernel.org, linux-xfs@vger.kernel.org, guan@eryu.me Date: Tue, 26 Mar 2024 19:43:35 -0700 Message-ID: <171150741593.3286541.18115194618541313905.stgit@frogsfrogsfrogs> In-Reply-To: <171150739778.3286541.16038231600708193472.stgit@frogsfrogsfrogs> References: <171150739778.3286541.16038231600708193472.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong XFS has this behavior in its reflink implementation where it returns ENOSPC if one of the AGs that would be involved in the sharing operation becomes more than 90% full. As Kent Overstreet points out, that means the snapshot creator shuts down when the filesystem is only about a third full. We could exercise the system harder by not *forcing* reflink, which will actually fill the filesystem full. Signed-off-by: Darrick J. Wong --- common/reflink | 8 ++++++++ tests/generic/166 | 2 +- tests/generic/167 | 2 +- tests/generic/333 | 2 +- tests/generic/334 | 2 +- tests/generic/671 | 2 +- 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/common/reflink b/common/reflink index 22adc4449b..8f30dc6784 100644 --- a/common/reflink +++ b/common/reflink @@ -226,6 +226,14 @@ _cp_reflink() { cp --reflink=always -p -f "$file1" "$file2" } +# Create file2 as a snapshot of file1 via cp and possibly reflink. +_reflink_snapshot() { + file1="$1" + file2="$2" + + cp --reflink=auto -p -f "$file1" "$file2" +} + # Reflink some file1 into file2 _reflink() { file1="$1" diff --git a/tests/generic/166 b/tests/generic/166 index 0eb2ec9c3a..941b51b3f1 100755 --- a/tests/generic/166 +++ b/tests/generic/166 @@ -60,7 +60,7 @@ snappy() { sleep 0.01 continue; fi - out="$(_cp_reflink $testdir/file1 $testdir/snap_$n 2>&1)" + out="$(_reflink_snapshot $testdir/file1 $testdir/snap_$n 2>&1)" res=$? echo "$out" | grep -q "No space left" && break test -n "$out" && echo "$out" diff --git a/tests/generic/167 b/tests/generic/167 index ae5fa5eb1c..3670940825 100755 --- a/tests/generic/167 +++ b/tests/generic/167 @@ -50,7 +50,7 @@ _scratch_cycle_mount snappy() { n=0 while [ ! -e $finished_file ]; do - out="$(_cp_reflink $testdir/file1 $testdir/snap_$n 2>&1)" + out="$(_reflink_snapshot $testdir/file1 $testdir/snap_$n 2>&1)" res=$? echo "$out" | grep -q "No space left" && break test -n "$out" && echo "$out" diff --git a/tests/generic/333 b/tests/generic/333 index bf1967ce29..19e69993a3 100755 --- a/tests/generic/333 +++ b/tests/generic/333 @@ -53,7 +53,7 @@ _scratch_cycle_mount snappy() { n=0 while [ ! -e $finished_file ]; do - out="$(_cp_reflink $testdir/file1 $testdir/snap_$n 2>&1)" + out="$(_reflink_snapshot $testdir/file1 $testdir/snap_$n 2>&1)" res=$? echo $out | grep -q "No space left" && break test -n "$out" && echo $out diff --git a/tests/generic/334 b/tests/generic/334 index b9c14b87ac..1e4d37b415 100755 --- a/tests/generic/334 +++ b/tests/generic/334 @@ -52,7 +52,7 @@ _scratch_cycle_mount snappy() { n=0 while [ ! -e $finished_file ]; do - out="$(_cp_reflink $testdir/file1 $testdir/snap_$n 2>&1)" + out="$(_reflink_snapshot $testdir/file1 $testdir/snap_$n 2>&1)" res=$? echo $out | grep -q "No space left" && break test -n "$out" && echo $out diff --git a/tests/generic/671 b/tests/generic/671 index b6cc0573f3..24ed24e213 100755 --- a/tests/generic/671 +++ b/tests/generic/671 @@ -41,7 +41,7 @@ _scratch_cycle_mount snappy() { n=0 while [ ! -e $finished_file ]; do - out="$(_cp_reflink $testdir/file1 $testdir/snap_$n 2>&1)" + out="$(_reflink_snapshot $testdir/file1 $testdir/snap_$n 2>&1)" res=$? echo "$out" | grep -q "No space left" && break test -n "$out" && echo "$out" From patchwork Wed Mar 27 02:43:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13605506 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 825031CD2B; Wed, 27 Mar 2024 02:43:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711507422; cv=none; b=qpJUljNW1362zg1IncVpoJlGmyAA5KQo9x+AeFNh0vsyESE93tBZr23iHmr6aVIQSbrpzgfHnx/cQ3fEeDiM6wf0IrZTzxgQVJk3j0h4iPpTsITDMHbq1Y5K7PvMVWS97YDTWhd+zNXPMtnC4rhymt/7abGREM4zyFXoezFKVBU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711507422; c=relaxed/simple; bh=IG88Lepce6s0skeT7uh1mvnMKFQVVFwX7vG7KogjAro=; h=Subject:From:To:Cc:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=W4PT3C+84rr1V40DdLo0bwwAcvjQx/N2Lcv4sqyVRB4z7ovG60Rrx4At9ss8o32/zPqBjiOYqRTxr87FXMTZX8aMqz+VZTQE6aopRtmqBU6mbBE9Dc4+giwGk9ya2xoaG0VTaXB3WTJgiw0mDyXRjBz71zcQFhoPkle0+u+CtZk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FGtjoVXo; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FGtjoVXo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 148FEC433F1; Wed, 27 Mar 2024 02:43:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711507422; bh=IG88Lepce6s0skeT7uh1mvnMKFQVVFwX7vG7KogjAro=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=FGtjoVXo6OurfqfvOt1Cy8W+K+EqZc8T2GJv9OnwSN7vKyJ56W5YBnE/FuR8HaetX +oz8RthgzqzAhOFj4YY4ZHXyr16LPj4T0SlyTIEUUNeDDeUQuN2e+UYYz6PWShsgpI qryoX4B9biqEJhfj3kK95saoU7H656mfo/MvWC+sj6m6paQq+xb6FqCH/c0xzdVa3w 0pyiXvB02x2Z9aIpkJByFlkgkwNgi83LYzSJKsLdUQSsg6s3jtGkv5n1svJlfC97PV jrwU+mL2Wkt7pEaoLNmc/35Swy4GOGbMeVnDUd776s8Suo0GhHL2yiayj11G1BiXZ2 kAXi8cdKQ4VgA== Subject: [PATCH 4/4] generic: test MADV_POPULATE_READ with IO errors From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: David Hildenbrand , Christoph Hellwig , fstests@vger.kernel.org, linux-xfs@vger.kernel.org, guan@eryu.me Date: Tue, 26 Mar 2024 19:43:41 -0700 Message-ID: <171150742156.3286541.2986329968568619601.stgit@frogsfrogsfrogs> In-Reply-To: <171150739778.3286541.16038231600708193472.stgit@frogsfrogsfrogs> References: <171150739778.3286541.16038231600708193472.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong This is a regression test for "mm/madvise: make MADV_POPULATE_(READ|WRITE) handle VM_FAULT_RETRY properly". Cc: David Hildenbrand Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Zorro Lang --- tests/generic/1835 | 65 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/1835.out | 4 +++ 2 files changed, 69 insertions(+) create mode 100755 tests/generic/1835 create mode 100644 tests/generic/1835.out diff --git a/tests/generic/1835 b/tests/generic/1835 new file mode 100755 index 0000000000..07479ab712 --- /dev/null +++ b/tests/generic/1835 @@ -0,0 +1,65 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2024 Oracle. All Rights Reserved. +# +# FS QA Test 1835 +# +# This is a regression test for a kernel hang that I saw when creating a memory +# mapping, injecting EIO errors on the block device, and invoking +# MADV_POPULATE_READ on the mapping to fault in the pages. +# +. ./common/preamble +_begin_fstest auto rw + +# Override the default cleanup function. +_cleanup() +{ + cd / + rm -f $tmp.* + _dmerror_unmount + _dmerror_cleanup +} + +# Import common functions. +. ./common/dmerror + +_fixed_by_kernel_commit XXXXXXXXXXXX \ + "mm/madvise: make MADV_POPULATE_(READ|WRITE) handle VM_FAULT_RETRY properly" + +# real QA test starts here + +# Modify as appropriate. +_supported_fs generic +_require_xfs_io_command madvise -R +_require_scratch +_require_dm_target error +_require_command "$TIMEOUT_PROG" "timeout" + +_scratch_mkfs >> $seqres.full 2>&1 +_dmerror_init + +filesz=2m + +# Create a file that we'll read, then cycle mount to zap pagecache +_dmerror_mount +$XFS_IO_PROG -f -c "pwrite -S 0x58 0 $filesz" "$SCRATCH_MNT/a" >> $seqres.full +_dmerror_unmount +_dmerror_mount + +# Try to read the file data in a regular fashion just to prove that it works. +echo read with no errors +timeout -s KILL 10s $XFS_IO_PROG -c "mmap -r 0 $filesz" -c "madvise -R 0 $filesz" "$SCRATCH_MNT/a" +_dmerror_unmount +_dmerror_mount + +# Load file metadata and induce EIO errors on read. Try to provoke the kernel; +# kill the process after 10s so we can clean up. +stat "$SCRATCH_MNT/a" >> $seqres.full +echo read with IO errors +_dmerror_load_error_table +timeout -s KILL 10s $XFS_IO_PROG -c "mmap -r 0 $filesz" -c "madvise -R 0 $filesz" "$SCRATCH_MNT/a" +_dmerror_load_working_table + +# success, all done +status=0 +exit diff --git a/tests/generic/1835.out b/tests/generic/1835.out new file mode 100644 index 0000000000..1b03586e8c --- /dev/null +++ b/tests/generic/1835.out @@ -0,0 +1,4 @@ +QA output created by 1835 +read with no errors +read with IO errors +madvise: Bad address