From patchwork Wed Jan 18 00:42:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13105332 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4B51C00A5A for ; Wed, 18 Jan 2023 00:54:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229980AbjARAyZ (ORCPT ); Tue, 17 Jan 2023 19:54:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230026AbjARAyC (ORCPT ); Tue, 17 Jan 2023 19:54:02 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B1C74DBC7; Tue, 17 Jan 2023 16:42:16 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8B223B81A87; Wed, 18 Jan 2023 00:42:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 425F0C433D2; Wed, 18 Jan 2023 00:42:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674002534; bh=C/j8KnWAl6qPB7dLOaPsaGU+qM2DpDK0XBE285WozP4=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=TlydLeXZA8Jn0rutovsA6tK3rqCak6u0Ml2A8gtZB0vCNJ0gaaj2GRQoNJfD1AAqX bJw6fASRJW2OttHAIzo61wrCpsHWGHlvz6L7SG0hEAQIq6yN8LAX2NmM6M1Kp99C6S Gbz6JaWkT5Zas5DXc6lNCNoIvU7oDoIFi9V6e5QjHOgqgsvdHcEPRpsPEIJicUbds7 To9Gs5WAtrFSm/HoZOiUbjDT+36x6cJR/0LkM88g0z0HfYBTLATRv2dmrYQJi+gtMV PrftW+Qsu5XN33nyUL8gXxtJglsVyvhuV8usxc+anxgfiXmmTHgSaZzdWU+vd8xZ4y SvBfb/yUUTbpg== Date: Tue, 17 Jan 2023 16:42:13 -0800 Subject: [PATCH 1/3] xfs: fix dax inode flag test failures From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me, yangx.jy@fujitsu.com Message-ID: <167400102458.1914858.6889539595788984119.stgit@magnolia> In-Reply-To: <167400102444.1914858.13132645140135239531.stgit@magnolia> References: <167400102444.1914858.13132645140135239531.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Filter out the DAX inode flag because it's causing problems with this test. Signed-off-by: Darrick J. Wong Reviewed-by: Xiao Yang --- tests/xfs/128 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/xfs/128 b/tests/xfs/128 index 5591342d41..8c1663c6c5 100755 --- a/tests/xfs/128 +++ b/tests/xfs/128 @@ -81,7 +81,7 @@ c13=$(_md5_checksum $testdir/file3) c14=$(_md5_checksum $testdir/file4) echo "Defragment" -lsattr -l $testdir/ | _filter_scratch | _filter_spaces +lsattr -l $testdir/ | _filter_scratch | _filter_spaces | sed -e 's/DAX/---/g' $XFS_FSR_PROG -v -d $testdir/file1 >> $seqres.full $XFS_FSR_PROG -v -d $testdir/file2 >> $seqres.full # fsr probably breaks the link $XFS_FSR_PROG -v -d $testdir/file3 >> $seqres.full # fsr probably breaks the link From patchwork Wed Jan 18 00:42:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13105333 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1A68C38142 for ; Wed, 18 Jan 2023 00:55:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230105AbjARAzO (ORCPT ); Tue, 17 Jan 2023 19:55:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229918AbjARAyj (ORCPT ); Tue, 17 Jan 2023 19:54:39 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6E305086C; Tue, 17 Jan 2023 16:42:43 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 273B3B81A8C; Wed, 18 Jan 2023 00:42:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE016C433EF; Wed, 18 Jan 2023 00:42:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674002549; bh=19ow3edlw8Rsikbi5VudHOFuvJvXwyRdvWaA/MAX0l4=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=L4gVK92bm29srK45fMM8uZo4SkURroE4CQdTgTG2G+mZykbjUcyBhEPzS0F6JOf08 7csP0DO2SOAuGQiWg4iitybooQIWp9dv6u7qrkafl1p6TstIvL1euJtaJGRrlGtS9l HC2AC82j3ZTq3qLoHIdc8EYbAnqZZvE5f9RdIZqUPJyivfm1Z88XLR6nutKy6db2AF nFOEN+n6O316p8CABHc6ywJ50GtABUBEOts6paL2LidS51j16eDhvemEwoVzzv68cK rEWzE1IKQGiPyStWgvfABvqlyAWteEC0yOgypHmxoWFEqUrWmt+pmee9yMt7Z7AzWz sf3R5p6WceePg== Date: Tue, 17 Jan 2023 16:42:29 -0800 Subject: [PATCH 2/3] xfs: fix reflink test failures when dax is enabled From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me, yangx.jy@fujitsu.com Message-ID: <167400102472.1914858.16726369189467075623.stgit@magnolia> In-Reply-To: <167400102444.1914858.13132645140135239531.stgit@magnolia> References: <167400102444.1914858.13132645140135239531.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Turn off reflink tests that require delayed allocation to work, because we don't use delayed allocation when fsdax mode is turned on. Signed-off-by: Darrick J. Wong Reviewed-by: Xiao Yang --- tests/xfs/184 | 1 + tests/xfs/192 | 1 + tests/xfs/200 | 1 + tests/xfs/204 | 1 + tests/xfs/232 | 1 + tests/xfs/440 | 1 + 6 files changed, 6 insertions(+) diff --git a/tests/xfs/184 b/tests/xfs/184 index c251040e8a..3bdd86addf 100755 --- a/tests/xfs/184 +++ b/tests/xfs/184 @@ -19,6 +19,7 @@ _begin_fstest auto quick clone fiemap unshare # real QA test starts here _supported_fs xfs +_require_scratch_delalloc _require_scratch_reflink _require_cp_reflink _require_xfs_io_command "fiemap" diff --git a/tests/xfs/192 b/tests/xfs/192 index 85ed7a48fc..ced18fa3c1 100755 --- a/tests/xfs/192 +++ b/tests/xfs/192 @@ -19,6 +19,7 @@ _begin_fstest auto quick clone fiemap unshare # real QA test starts here _supported_fs xfs +_require_scratch_delalloc _require_scratch_reflink _require_cp_reflink _require_xfs_io_command "fiemap" diff --git a/tests/xfs/200 b/tests/xfs/200 index f91bfbf478..b51b9a54f5 100755 --- a/tests/xfs/200 +++ b/tests/xfs/200 @@ -21,6 +21,7 @@ _begin_fstest auto quick clone fiemap unshare # real QA test starts here _supported_fs xfs +_require_scratch_delalloc _require_scratch_reflink _require_cp_reflink _require_xfs_io_command "fiemap" diff --git a/tests/xfs/204 b/tests/xfs/204 index d034446bbc..ca21dfe722 100755 --- a/tests/xfs/204 +++ b/tests/xfs/204 @@ -21,6 +21,7 @@ _begin_fstest auto quick clone fiemap unshare # real QA test starts here _supported_fs xfs +_require_scratch_delalloc _require_scratch_reflink _require_cp_reflink _require_xfs_io_command "fiemap" diff --git a/tests/xfs/232 b/tests/xfs/232 index f402ad6cf3..59bbc43686 100755 --- a/tests/xfs/232 +++ b/tests/xfs/232 @@ -30,6 +30,7 @@ _cleanup() # real QA test starts here _supported_fs xfs +_require_scratch_delalloc _require_xfs_io_command "cowextsize" _require_scratch_reflink _require_cp_reflink diff --git a/tests/xfs/440 b/tests/xfs/440 index 496ee04edf..368ee8a05d 100755 --- a/tests/xfs/440 +++ b/tests/xfs/440 @@ -20,6 +20,7 @@ _begin_fstest auto quick clone quota _supported_fs xfs _require_quota +_require_scratch_delalloc _require_scratch_reflink _require_cp_reflink _require_user From patchwork Wed Jan 18 00:42:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13105334 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68507C00A5A for ; Wed, 18 Jan 2023 00:55:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229918AbjARAzz (ORCPT ); Tue, 17 Jan 2023 19:55:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230092AbjARAzL (ORCPT ); Tue, 17 Jan 2023 19:55:11 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76B1C530CA; Tue, 17 Jan 2023 16:43:05 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B1525B81A85; Wed, 18 Jan 2023 00:42:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58871C433D2; Wed, 18 Jan 2023 00:42:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674002565; bh=nuQWmBjgfsOLI56ZOT417vwv86d4VyIVOLPSiBtr8/g=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=m2rV3p0Ll1O3Gf2ijjDZzrUjfqfPa5jRtSKhQuzfUF2MSdoq4offxbaPHmQQYPf7h 4e6RJ32q4ppyqnyRiA1pceBEnOaoMB6EO9gBkaL++EFmmQra9oH+MsscTex/YX/Uk+ UGhapA0V33x0vBEJeP5oAW6niouARsB4PEeMzUbcxqlJaN0Zv7ync+UynMkHcplhgj zYyNLycr0rwSFitHjexb0LNSxQ9IUKzurKU1AArDIzOHOgnuyJtXrO+vLqwduZlhPe seY/bZ+f7xXSscj0fbM9lM8OxPCrMDB2CRvzTParLZhLpcn70rzPjMw/uXXv9Ayrog AcI5C+ngSuuXg== Date: Tue, 17 Jan 2023 16:42:44 -0800 Subject: [PATCH 3/3] xfs/182: fix spurious direct write failure From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me, yangx.jy@fujitsu.com Message-ID: <167400102485.1914858.8399289411855614483.stgit@magnolia> In-Reply-To: <167400102444.1914858.13132645140135239531.stgit@magnolia> References: <167400102444.1914858.13132645140135239531.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong This test has some weird behavior that causes regressions when fsdax and reflink are enabled. The goal of this test is to set a cow extent size hint, perform some random directio writes, perform a directio rewrite of the entire file, and make sure that the file content (and extent count) are sane afterwards. Most of the time, the random directio writes will never touch the 8388609th byte, though if they do randomly select that EOF block, they'd end up extending the file by $real_blksz bytes and causing spurious test failures. Then, the rewrite does this: pwrite -S 0x63 -b $real_blksz 0 $((filesize + 1)) Note that we previously set filesize=8388608, which means that we're asking for a series of direct writes that fill the first 8388608 bytes with 'c'. The last write in the series becomes a single byte direct write. For regular file access mode, this last write will fail with EINVAL, since block devices do not support byte granularity writes and XFS does not fall back to the pagecache for unaligned direct wites. Hence we never wrote the 8388609th byte of the file. However, fsdax *does* allow byte-granularity direct writes, which means that the single-byte write succeeds. There is no EINVAL return code, and the 8388609th byte of the file is now 'c' instead of 'a'. As a result, the md5 of file2 is different. Since fsdax+reflink is the newcomer, amend the direct writes in this test so that they always end at the 8388608th byte, since we were never really testing that last byte anyway. This makes the test behavior consistent across both access modes. Signed-off-by: Darrick J. Wong Reviewed-by: Xiao Yang --- tests/xfs/182 | 4 ++-- tests/xfs/182.out | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/xfs/182 b/tests/xfs/182 index ec3f7dc026..696b933e60 100755 --- a/tests/xfs/182 +++ b/tests/xfs/182 @@ -55,9 +55,9 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" $XFS_IO_PROG -f -c "cowextsize" $testdir/file2 >> $seqres.full -$XFS_IO_PROG -d -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $((filesize + 1))" \ +$XFS_IO_PROG -d -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $filesize" \ $testdir/file2 2>&1 >> $seqres.full | _filter_xfs_io_error -$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $real_blksz 0 $((filesize + 1))" \ +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $real_blksz 0 $filesize" \ $testdir/file2 2>&1 >> $seqres.full | _filter_xfs_io_error _scratch_cycle_mount diff --git a/tests/xfs/182.out b/tests/xfs/182.out index 41384437ad..8821bcd5bd 100644 --- a/tests/xfs/182.out +++ b/tests/xfs/182.out @@ -5,7 +5,6 @@ Compare files 2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-182/file1 2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-182/file2 CoW and unmount -pwrite: Invalid argument Compare files 2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-182/file1 c6ba35da9f73ced20d7781a448cc11d4 SCRATCH_MNT/test-182/file2