From patchwork Tue Jun 28 20:21:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 12898905 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 91654C433EF for ; Tue, 28 Jun 2022 20:24:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233077AbiF1UYt (ORCPT ); Tue, 28 Jun 2022 16:24:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232934AbiF1UYI (ORCPT ); Tue, 28 Jun 2022 16:24:08 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 594E2C39; Tue, 28 Jun 2022 13:21:26 -0700 (PDT) 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 0E872B8203F; Tue, 28 Jun 2022 20:21:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0FE1C3411D; Tue, 28 Jun 2022 20:21:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656447683; bh=ymJ/MhoVSEN2EqobOvoYw1b3Acb52Dh/mWtxnlb5Pjc=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=I0Ss/OM3Dn8SWRCNBvdTNEXQOX6ObBsPFUyCy6Klw1O01j6Vw5/rzoMNkEB4tauJ3 C1RDdqFPOi4SC6NYBQ6mbmlDuF9mi3eegSdcpK/9C6vzzSsbzSmci26cm3d0ivkkfE rPYAGuVxx/n+2hdQl3R+baQZ+4+qapATczYzBuQyr9jQMg4N8bBoPEjlzISQ23NqnN 58+f1QU55zqRq0KI/JYjiJm15i5SGTECseyb8Cd2aK/eW+pRsg6m3yqdsrGMES4c0R MTrwn5FfOyz3qVUz8PSqN63/gmZiU1QDC+AnQnrB1XwQIxDcZerEsR/tjSzd+jFIBk FXXHtH0aTgD7A== Subject: [PATCH 1/9] seek_sanity_test: fix allocation unit detection on XFS realtime From: "Darrick J. Wong" To: djwong@kernel.org, guaneryu@gmail.com, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me Date: Tue, 28 Jun 2022 13:21:23 -0700 Message-ID: <165644768327.1045534.10420155448662856970.stgit@magnolia> In-Reply-To: <165644767753.1045534.18231838177395571946.stgit@magnolia> References: <165644767753.1045534.18231838177395571946.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 The seek sanity test tries to figure out a file space allocation unit by calling stat and then using an iterative SEEK_DATA method to try to detect a smaller blocksize based on SEEK_DATA's consultation of the filesystem's internal block mapping. This was put in (AFAICT) because XFS' stat implementation returns max(filesystem blocksize, PAGESIZE) for most regular files. Unfortunately, for a realtime file with an extent size larger than a single filesystem block this doesn't work at all because block mappings still work at filesystem block granularity, but allocation units do not. To fix this, detect the specific case where st_blksize != PAGE_SIZE and trust the fstat results. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reported-by: liuyd.fnst@fujitsu.com Signed-off-by: Darrick J. Wong --- src/seek_sanity_test.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/seek_sanity_test.c b/src/seek_sanity_test.c index 76587b7f..1030d0c5 100644 --- a/src/seek_sanity_test.c +++ b/src/seek_sanity_test.c @@ -45,6 +45,7 @@ static int get_io_sizes(int fd) off_t pos = 0, offset = 1; struct stat buf; int shift, ret; + int pagesz = sysconf(_SC_PAGE_SIZE); ret = fstat(fd, &buf); if (ret) { @@ -53,8 +54,16 @@ static int get_io_sizes(int fd) return ret; } - /* st_blksize is typically also the allocation size */ + /* + * st_blksize is typically also the allocation size. However, XFS + * rounds this up to the page size, so if the stat blocksize is exactly + * one page, use this iterative algorithm to see if SEEK_DATA will hint + * at a more precise answer based on the filesystem's (pre)allocation + * decisions. + */ alloc_size = buf.st_blksize; + if (alloc_size != pagesz) + goto done; /* try to discover the actual alloc size */ while (pos == 0 && offset < alloc_size) { @@ -80,6 +89,7 @@ static int get_io_sizes(int fd) if (!shift) offset += pos ? 0 : 1; alloc_size = offset; +done: fprintf(stdout, "Allocation size: %ld\n", alloc_size); return 0; From patchwork Tue Jun 28 20:21:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 12898906 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 2B1F3CCA479 for ; Tue, 28 Jun 2022 20:24:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233167AbiF1UYv (ORCPT ); Tue, 28 Jun 2022 16:24:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233057AbiF1UYJ (ORCPT ); Tue, 28 Jun 2022 16:24:09 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF2771B9; Tue, 28 Jun 2022 13:21:31 -0700 (PDT) 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 A6A34B8203F; Tue, 28 Jun 2022 20:21:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 599A2C3411D; Tue, 28 Jun 2022 20:21:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656447689; bh=2JOj/dlXSEREQSET8mJRQgRFukJ+oDopxcwXgx8GfoE=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=iEv6tl7GwXz1dOz/iBAFN/4tTr+9QmL+PAU7/nojB0wTaPzqyT8b0CAo44uCnAN0u I8ADdVvUoe0P1S1Tf/xRcZ+pGCZnPpgg3xbNshdXEeEt9D0Q4u6kBg3ye1REoEIYfa hro3rFjVhQihqY+Z90vUu4DH50m9M87Uc1uEGjvqoHKblDvUOHqCmj5+nqUxmPAAs4 EmfXkNksBw1Vbs/vtDFkSSDaTRAMHcQi0IzLDwJ+bUsDDdtXCjQtEgWydPBRfeOjv4 2Pyv/ZjE8guAF3hP3kU7Jf96D1xUvCWSyFxuN/QuN3zhdM3k+TauxPrb/EGJzU0CCs KMxY6yP+SfUMA== Subject: [PATCH 2/9] xfs/070: filter new superblock verifier messages From: "Darrick J. Wong" To: djwong@kernel.org, guaneryu@gmail.com, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me Date: Tue, 28 Jun 2022 13:21:28 -0700 Message-ID: <165644768886.1045534.3177166462110135738.stgit@magnolia> In-Reply-To: <165644767753.1045534.18231838177395571946.stgit@magnolia> References: <165644767753.1045534.18231838177395571946.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 In Linux 5.19, the superblock verifier logging changed to elaborate on what was wrong. Fix the xfs_repair filtering function to accomodate this development. Signed-off-by: Darrick J. Wong --- common/repair | 1 + 1 file changed, 1 insertion(+) diff --git a/common/repair b/common/repair index 463ef9db..398e9904 100644 --- a/common/repair +++ b/common/repair @@ -29,6 +29,7 @@ _filter_repair() # for sb /- agno = / && next; # remove each AG line (variable number) s/(pointer to) (\d+)/\1 INO/; +s/Superblock has bad magic number.*/bad magic number/; # Changed inode output in 5.5.0 s/sb root inode value /sb root inode /; s/realtime bitmap inode value /realtime bitmap inode /; From patchwork Tue Jun 28 20:21:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 12898908 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 B8CADCCA47E for ; Tue, 28 Jun 2022 20:25:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232589AbiF1UZB (ORCPT ); Tue, 28 Jun 2022 16:25:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233296AbiF1UYS (ORCPT ); Tue, 28 Jun 2022 16:24:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53B3ABE3; Tue, 28 Jun 2022 13:21:38 -0700 (PDT) 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 6E2E6B8203F; Tue, 28 Jun 2022 20:21:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC574C3411D; Tue, 28 Jun 2022 20:21:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656447695; bh=tkf4ZBYvddxs2azDnfnVIQXTaEIc3EGZsrX2KCbOF4s=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=maEj+S8igmiGAzmAUb7jlS0KLi0mDmCgZCgh0fEe9AaO/RxXddacy1KNGniJDhL1e mVWD4/uOTpksrPOjfRegKII8GhrSIMIi7dyxDS8CKGAk4JzdUG2hIITczZMOTS4wTp vV9iMN9JZhn24/g5v1vLddQgAQM/hRvpsUocKjoBrPGtpwWQtybNPlo4lQgy2dPX2G 9GE78MT52tkdMhcBGMqCOtNW+qtNDiLEUgHFnuKayzecNnHTI8rr8k2cUdPgiZ+ugb PpD0Hq4wD45l7T3tzltdKr1woFC4ygz4jmC7FVTiDJSh6ZyIu2A5IqiAh6UN8Xp9b0 4BbF1iqmP4tpg== Subject: [PATCH 3/9] xfs: test mkfs.xfs sizing of internal logs that From: "Darrick J. Wong" To: djwong@kernel.org, guaneryu@gmail.com, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me Date: Tue, 28 Jun 2022 13:21:34 -0700 Message-ID: <165644769450.1045534.8663346508633304230.stgit@magnolia> In-Reply-To: <165644767753.1045534.18231838177395571946.stgit@magnolia> References: <165644767753.1045534.18231838177395571946.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 is a regression test that exercises the mkfs.xfs code that creates log sizes that are very close to the AG size when stripe units are in play and/or when the log is forced to be in AG 0. Signed-off-by: Darrick J. Wong --- tests/xfs/843 | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/843.out | 2 ++ 2 files changed, 53 insertions(+) create mode 100755 tests/xfs/843 create mode 100644 tests/xfs/843.out diff --git a/tests/xfs/843 b/tests/xfs/843 new file mode 100755 index 00000000..5bb4bfb4 --- /dev/null +++ b/tests/xfs/843 @@ -0,0 +1,51 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2022 Oracle. All Rights Reserved. +# +# FS QA Test 843 +# +# Now that we've increased the default log size calculation, test mkfs with +# various stripe units and filesystem sizes to see if we can provoke mkfs into +# breaking. +# +. ./common/preamble +_begin_fstest auto mkfs + +# real QA test starts here + +# Modify as appropriate. +_supported_fs xfs +_require_test +echo Silence is golden + +testfile=$TEST_DIR/a +rm -f $testfile + +test_format() { + local tag="$1" + shift + + echo "$tag" >> $seqres.full + $MKFS_XFS_PROG $@ -d file,name=$testfile &>> $seqres.full + local res=$? + test $res -eq 0 || echo "$tag FAIL $res" | tee -a $seqres.full +} + +# First we try various small filesystems and stripe sizes. +for M in `seq 298 302` `seq 490 520`; do + for S in `seq 32 4 64`; do + test_format "M=$M S=$S" -dsu=${S}k,sw=1,size=${M}m -N + done +done + +# Log so large it pushes the root dir into AG 1. We can't use -N for the mkfs +# because this check only occurs after the root directory has been allocated, +# which mkfs -N doesn't do. +test_format "log pushes rootdir into AG 1" -d agcount=3200,size=6366g -lagnum=0 -N + +# log end rounded beyond EOAG due to stripe unit +test_format "log end beyond eoag" -d agcount=3200,size=6366g -d su=256k,sw=4 -N + +# success, all done +status=0 +exit diff --git a/tests/xfs/843.out b/tests/xfs/843.out new file mode 100644 index 00000000..87c13504 --- /dev/null +++ b/tests/xfs/843.out @@ -0,0 +1,2 @@ +QA output created by 843 +Silence is golden From patchwork Tue Jun 28 20:21:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 12898909 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 5ECE5CCA479 for ; Tue, 28 Jun 2022 20:25:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232519AbiF1UZA (ORCPT ); Tue, 28 Jun 2022 16:25:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233297AbiF1UYS (ORCPT ); Tue, 28 Jun 2022 16:24:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 307D81C4; Tue, 28 Jun 2022 13:21:43 -0700 (PDT) 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 C579BB81BED; Tue, 28 Jun 2022 20:21:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8CB87C3411D; Tue, 28 Jun 2022 20:21:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656447700; bh=tiPDfwHrOYk4kde7l9WtFOYFYC8Zo9Mdy1epE/sOEUc=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=e1/8FCUUD7371eYpDKovKZmSUIe0jfriyt9AaUqgul0xefictsYVyTu2PLgJbwUXw ZwkPf8FMksSq3SjBHiag70Jj570yOuNO81qesmZTbLX+ZzgREj6y3YKWh+w7afPbx4 UkQgTDo7No+mRxDjYaiDIxkEhAmoxbFrtpWCD3DzFrrBD7TWcvtQ6blbFMAY/RfS5N 43tHm3Iaq1XuvGtrTfiGcpUkMaPEKcEH/bhvfDRbstYrBjmp9AZj0W+vI8qhh/AFve e9QJoymp4c2BD+Biu90QOyTY7sZb/XSVKXe6P/tEuE9bQGWS7Kfu+tIvgjQ2oyKpOi FuI9jpY2EeSIQ== Subject: [PATCH 4/9] xfs: test xfs_copy doesn't do cached read before libxfs_mount From: "Darrick J. Wong" To: djwong@kernel.org, guaneryu@gmail.com, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me Date: Tue, 28 Jun 2022 13:21:40 -0700 Message-ID: <165644770013.1045534.5572366430392518217.stgit@magnolia> In-Reply-To: <165644767753.1045534.18231838177395571946.stgit@magnolia> References: <165644767753.1045534.18231838177395571946.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 is a regression test for an xfs_copy fix that ensures that it doesn't perform a cached read of an XFS filesystem prior to initializing libxfs, since the xfs_mount (and hence the buffer cache) isn't set up yet. Signed-off-by: Darrick J. Wong --- tests/xfs/844 | 33 +++++++++++++++++++++++++++++++++ tests/xfs/844.out | 3 +++ 2 files changed, 36 insertions(+) create mode 100755 tests/xfs/844 create mode 100644 tests/xfs/844.out diff --git a/tests/xfs/844 b/tests/xfs/844 new file mode 100755 index 00000000..688abe33 --- /dev/null +++ b/tests/xfs/844 @@ -0,0 +1,33 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2022 Oracle. All Rights Reserved. +# +# FS QA Test 844 +# +# Regression test for xfsprogs commit: +# +# XXXXXXXX ("xfs_copy: don't use cached buffer reads until after libxfs_mount") +# +. ./common/preamble +_begin_fstest auto copy + +# real QA test starts here + +# Modify as appropriate. +_supported_fs generic +_require_xfs_copy +_require_test + +rm -f $TEST_DIR/$seq.* +$XFS_IO_PROG -f -c 'truncate 100m' $TEST_DIR/$seq.a +$XFS_IO_PROG -f -c 'truncate 100m' $TEST_DIR/$seq.b + +filter_copy() { + sed -e 's/Superblock has bad magic number.*/bad magic number/' +} + +$XFS_COPY_PROG $TEST_DIR/$seq.a $TEST_DIR/$seq.b 2>&1 | filter_copy + +# success, all done +status=0 +exit diff --git a/tests/xfs/844.out b/tests/xfs/844.out new file mode 100644 index 00000000..dbefde1c --- /dev/null +++ b/tests/xfs/844.out @@ -0,0 +1,3 @@ +QA output created by 844 +bad magic number +xfs_copy: couldn't read superblock, error=22 From patchwork Tue Jun 28 20:21:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 12898907 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 EAC3BC433EF for ; Tue, 28 Jun 2022 20:25:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231356AbiF1UY7 (ORCPT ); Tue, 28 Jun 2022 16:24:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229866AbiF1UYU (ORCPT ); Tue, 28 Jun 2022 16:24:20 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CA3A140EE; Tue, 28 Jun 2022 13:21:48 -0700 (PDT) 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 8275FB8203F; Tue, 28 Jun 2022 20:21:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 284DFC3411D; Tue, 28 Jun 2022 20:21:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656447706; bh=XYlAphFMdsvmnzakkhya87ROjW4zWZT4k+Q/98btdiM=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=ae6GU5qv7wBWgIvFP8u7UBUSO0nBVK7Sf5yY8DRayFbSL6Scj72RBcmnnwuWiv/wF YR0rnqNEJlPoHvV+/wHDVZSuXIsuS2BAh72+UgCpi/94EifuCjUWN/FkB7qElPCGLV ztFwi7m8IzQfsNWvWDYppg+a7nNpRJkxfMD1tA2azjXy8+R0UXFIaYlKLfRTy+h/Vk EdZriT3hv8S6oEcy1do7txmDtHZy9j2EM9RZ+YN0VIlt9L0TAvN7EoeVPEaoof0EQ4 7XSxO2XKcNGoESS95Nejz0EhBod9pHLVjbSwSQs4sNhEV8W4/2LuRV5E2z2r1m3zTp mtjZjvk9wYaEA== Subject: [PATCH 5/9] check: document mkfs.xfs reliance on fstests exports From: "Darrick J. Wong" To: djwong@kernel.org, guaneryu@gmail.com, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me Date: Tue, 28 Jun 2022 13:21:45 -0700 Message-ID: <165644770574.1045534.3646229611370914936.stgit@magnolia> In-Reply-To: <165644767753.1045534.18231838177395571946.stgit@magnolia> References: <165644767753.1045534.18231838177395571946.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 There are a number of fstests that employ special (and now unsupported) XFS filesystem configurations to perform testing in a controlled environment. The presence of the QA_CHECK_FS and MSGVERB variables are used by mkfs.xfs to detect that it's running inside fstests, which enables the unsupported configurations. Nobody else should be using filesystems with tiny logs, non-redundant superblocks, or smaller than the (new) minimum supported size. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner --- check | 3 +++ 1 file changed, 3 insertions(+) diff --git a/check b/check index 2ea2920f..4b0ebad6 100755 --- a/check +++ b/check @@ -33,6 +33,9 @@ _err_msg="" # start the initialisation work now iam=check +# mkfs.xfs uses the presence of both of these variables to enable formerly +# supported tiny filesystem configurations that fstests use for fuzz testing +# in a controlled environment export MSGVERB="text:action" export QA_CHECK_FS=${QA_CHECK_FS:=true} From patchwork Tue Jun 28 20:21:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 12898910 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 72D19C43334 for ; Tue, 28 Jun 2022 20:25:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231361AbiF1UZB (ORCPT ); Tue, 28 Jun 2022 16:25:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229521AbiF1UYX (ORCPT ); Tue, 28 Jun 2022 16:24:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2AB3280; Tue, 28 Jun 2022 13:21:52 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 5EDC661709; Tue, 28 Jun 2022 20:21:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BAEBFC3411D; Tue, 28 Jun 2022 20:21:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656447711; bh=l3he3Ym32oYQYPvckfK/RcZZHkq03B/5/Pb58aucCps=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=fWw+6xmpZwTypXg3ev7lUcujEhjUwZ3+Ha0mG8yxcxx6uDbkFuoA8Z2Ah1kkID6vF 4YrgZI9H3x5tgH8x2rjQ+F0zwlkozY0TaYiD2owK3YCHaPsp3zJZ9gOIwwlDJ7Lq6f StWFM6Yv7Lzm9b+HUTFQT8REqBnpM+alCtK7+JZEehw3gLUCxtDAmQlNWgSbfT1F96 9Rd5Qe61LfCZKepEXb1w3JHxN3k14nZkNWc8H20bfWjc5QawAVhmcDpQYSijtPQw15 kvcplfJQcalVcb8fEKlbLzEvAfiDFMS5CuaHuCDh9qA+XM+MH10TUW0+L9x6SdGtdv 3UuuItA25U6TA== Subject: [PATCH 6/9] xfs/109: handle larger minimum filesystem size From: "Darrick J. Wong" To: djwong@kernel.org, guaneryu@gmail.com, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me Date: Tue, 28 Jun 2022 13:21:51 -0700 Message-ID: <165644771132.1045534.358827009181930377.stgit@magnolia> In-Reply-To: <165644767753.1045534.18231838177395571946.stgit@magnolia> References: <165644767753.1045534.18231838177395571946.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 mkfs will soon refuse to format a filesystem smaller than 300MB, so increase the size of the filesystem to keep this test scenario realistic. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner --- tests/xfs/109 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/xfs/109 b/tests/xfs/109 index 6cb6917a..e3e491f1 100755 --- a/tests/xfs/109 +++ b/tests/xfs/109 @@ -78,7 +78,7 @@ if [ -n "$FASTSTART" -a -f $SCRATCH_MNT/f0 ]; then fi _scratch_unmount -_scratch_mkfs_xfs -dsize=160m,agcount=4 $faststart | _filter_mkfs 2>$tmp.mkfs +_scratch_mkfs_xfs -dsize=320m,agcount=4 $faststart | _filter_mkfs 2>$tmp.mkfs cat $tmp.mkfs >>$seqres.full _scratch_mount From patchwork Tue Jun 28 20:21:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 12898911 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 CE3CACCA481 for ; Tue, 28 Jun 2022 20:25:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233297AbiF1UZD (ORCPT ); Tue, 28 Jun 2022 16:25:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232560AbiF1UYa (ORCPT ); Tue, 28 Jun 2022 16:24:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7415DE65; Tue, 28 Jun 2022 13:21:58 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id E9A0C6172C; Tue, 28 Jun 2022 20:21:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 531E0C3411D; Tue, 28 Jun 2022 20:21:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656447717; bh=ySxfF9fscDH6cZg0RsDEP20WDx0C5u0nTxp0IEZHLQw=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=fhDDmOK8oFIujHoSSqlR+jBwD3MzA3s9xU6ZUApY3x7ibyzMvUO0p1kXhkKwiCfiY mCgyaC1SiAe7fYj1FZiMTio4VqHdgQX8IhGFbihrf0iyNAL6jNCSvyAsUBZCm90dn7 LVkfmxUXeXTZYSdQqqsN55gWgRQlu6OnPd3hk77eSrpSehbVcKZUcm8kC2eaafEkMJ Pqz39i+mHqDBK93x4B3O3JKORGVceyy/wTsBW6ryf7Pp49Or227RQ3MwIiVWwxh/pq wF8BXqjNDTQoOE4pJPitiyvjYXP2kZqVQov36J87Jb4qm02RzNx/XFeoqeCggtOEr9 GLDGS3pb2+j6A== Subject: [PATCH 7/9] xfs/018: fix LARP testing for small block sizes From: "Darrick J. Wong" To: djwong@kernel.org, guaneryu@gmail.com, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me Date: Tue, 28 Jun 2022 13:21:56 -0700 Message-ID: <165644771693.1045534.10562748026669892236.stgit@magnolia> In-Reply-To: <165644767753.1045534.18231838177395571946.stgit@magnolia> References: <165644767753.1045534.18231838177395571946.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 Fix this test to work properly when the filesystem block size is less than 4k. Tripping the error injection points on shape changes in the xattr structure must be done dynamically. Signed-off-by: Darrick J. Wong --- tests/xfs/018 | 52 +++++++++++++++++++++++++++++++++++++++++++++++----- tests/xfs/018.out | 16 ++++------------ 2 files changed, 51 insertions(+), 17 deletions(-) diff --git a/tests/xfs/018 b/tests/xfs/018 index 041a3b24..14a6f716 100755 --- a/tests/xfs/018 +++ b/tests/xfs/018 @@ -54,6 +54,45 @@ test_attr_replay() echo "" } +test_attr_replay_loop() +{ + testfile=$testdir/$1 + attr_name=$2 + attr_value=$3 + flag=$4 + error_tag=$5 + + # Inject error + _scratch_inject_error $error_tag + + # Set attribute; hopefully 1000 of them is enough to cause whatever + # attr structure shape change that the caller wants to test. + for ((i = 0; i < 1024; i++)); do + echo "$attr_value" | \ + ${ATTR_PROG} -$flag "$attr_name$i" $testfile > $tmp.out 2> $tmp.err + cat $tmp.out $tmp.err >> $seqres.full + cat $tmp.err | _filter_scratch | sed -e 's/attr_name[0-9]*/attr_nameXXXX/g' + touch $testfile &>/dev/null || break + done + + # FS should be shut down, touch will fail + touch $testfile 2>&1 | _filter_scratch + + # Remount to replay log + _scratch_remount_dump_log >> $seqres.full + + # FS should be online, touch should succeed + touch $testfile + + # Verify attr recovery + $ATTR_PROG -l $testfile >> $seqres.full + echo "Checking contents of $attr_name$i" >> $seqres.full + echo -n "${attr_name}XXXX: " + $ATTR_PROG -q -g $attr_name$i $testfile 2> /dev/null | md5sum; + + echo "" +} + create_test_file() { filename=$testdir/$1 @@ -88,6 +127,7 @@ echo 1 > /sys/fs/xfs/debug/larp attr16="0123456789ABCDEF" attr64="$attr16$attr16$attr16$attr16" attr256="$attr64$attr64$attr64$attr64" +attr512="$attr256$attr256" attr1k="$attr256$attr256$attr256$attr256" attr4k="$attr1k$attr1k$attr1k$attr1k" attr8k="$attr4k$attr4k" @@ -140,12 +180,14 @@ test_attr_replay extent_file1 "attr_name2" $attr1k "s" "larp" test_attr_replay extent_file1 "attr_name2" $attr1k "r" "larp" # extent, inject error on split -create_test_file extent_file2 3 $attr1k -test_attr_replay extent_file2 "attr_name4" $attr1k "s" "da_leaf_split" +create_test_file extent_file2 0 $attr1k +test_attr_replay_loop extent_file2 "attr_name" $attr1k "s" "da_leaf_split" -# extent, inject error on fork transition -create_test_file extent_file3 3 $attr1k -test_attr_replay extent_file3 "attr_name4" $attr1k "s" "attr_leaf_to_node" +# extent, inject error on fork transition. The attr value must be less than +# a full filesystem block so that the attrs don't use remote xattr values, +# which means we miss the leaf to node transition. +create_test_file extent_file3 0 $attr1k +test_attr_replay_loop extent_file3 "attr_name" $attr512 "s" "attr_leaf_to_node" # extent, remote create_test_file extent_file4 1 $attr1k diff --git a/tests/xfs/018.out b/tests/xfs/018.out index 022b0ca3..c3021ee3 100644 --- a/tests/xfs/018.out +++ b/tests/xfs/018.out @@ -87,22 +87,14 @@ Attribute "attr_name1" has a 1024 byte value for SCRATCH_MNT/testdir/extent_file attr_name2: d41d8cd98f00b204e9800998ecf8427e - attr_set: Input/output error -Could not set "attr_name4" for SCRATCH_MNT/testdir/extent_file2 +Could not set "attr_nameXXXX" for SCRATCH_MNT/testdir/extent_file2 touch: cannot touch 'SCRATCH_MNT/testdir/extent_file2': Input/output error -Attribute "attr_name4" has a 1025 byte value for SCRATCH_MNT/testdir/extent_file2 -Attribute "attr_name2" has a 1024 byte value for SCRATCH_MNT/testdir/extent_file2 -Attribute "attr_name3" has a 1024 byte value for SCRATCH_MNT/testdir/extent_file2 -Attribute "attr_name1" has a 1024 byte value for SCRATCH_MNT/testdir/extent_file2 -attr_name4: 9fd415c49d67afc4b78fad4055a3a376 - +attr_nameXXXX: 9fd415c49d67afc4b78fad4055a3a376 - attr_set: Input/output error -Could not set "attr_name4" for SCRATCH_MNT/testdir/extent_file3 +Could not set "attr_nameXXXX" for SCRATCH_MNT/testdir/extent_file3 touch: cannot touch 'SCRATCH_MNT/testdir/extent_file3': Input/output error -Attribute "attr_name4" has a 1025 byte value for SCRATCH_MNT/testdir/extent_file3 -Attribute "attr_name2" has a 1024 byte value for SCRATCH_MNT/testdir/extent_file3 -Attribute "attr_name3" has a 1024 byte value for SCRATCH_MNT/testdir/extent_file3 -Attribute "attr_name1" has a 1024 byte value for SCRATCH_MNT/testdir/extent_file3 -attr_name4: 9fd415c49d67afc4b78fad4055a3a376 - +attr_nameXXXX: a597dc41e4574873516420a7e4e5a3e0 - attr_set: Input/output error Could not set "attr_name2" for SCRATCH_MNT/testdir/extent_file4 From patchwork Tue Jun 28 20:22:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 12898912 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 936C8CCA47E for ; Tue, 28 Jun 2022 20:25:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232915AbiF1UZD (ORCPT ); Tue, 28 Jun 2022 16:25:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232921AbiF1UYp (ORCPT ); Tue, 28 Jun 2022 16:24:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2CF138BCC; Tue, 28 Jun 2022 13:22:03 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 925AD615DD; Tue, 28 Jun 2022 20:22:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7E1BC3411D; Tue, 28 Jun 2022 20:22:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656447723; bh=BAil+zq4pmcoLZscz2szx7QFIXfoqD67HveiQlnNTss=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=sxVC2HgiGMsG0+DPp7TxW1bMNu0fhVCljj4CQ4/XlWTY2QAMIqqHAqYYC862I6S8g i2cwGP1vpTJUNs4NDBTETOllhxYmk3Np4F/g3bu+w53d6faUKOJ/S4QV+GfAf/MWYZ FngfesdWzopMzx4Cq/ePVCzQrc0Kzz5cEM3xCXnihLebMHwdCTWW2GkhvKgYyQ33on h+eq/XknLYrAjAOE/TI8zHTeQ59DSxkjRaTqJ8dVd1XD+9XS4SIsONpxGSgpknxZxz YPG0+RXAdZKtwpSUJG+6M96pnyim4LKvkstR2R1Di3E1lV5SVj6fU4sPxdrv3gpoYm Vzb0FleRSLEAw== Subject: [PATCH 8/9] xfs/166: fix golden output failures when multipage folios enabled From: "Darrick J. Wong" To: djwong@kernel.org, guaneryu@gmail.com, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me Date: Tue, 28 Jun 2022 13:22:02 -0700 Message-ID: <165644772249.1045534.3583119178643533811.stgit@magnolia> In-Reply-To: <165644767753.1045534.18231838177395571946.stgit@magnolia> References: <165644767753.1045534.18231838177395571946.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 Beginning with 5.18, some filesystems support creating large folios for the page cache. A system with 64k pages can create 256k folios, which means that with the old file size of 1M, the last half of the file is completely converted from unwritten to written by page_mkwrite. The test encodes a translated version of the xfs_bmap output in the golden output, which means that the test now fails on 64k pages. Fixing the 64k page case by increasing the file size to 2MB broke fsdax because fsdax uses 2MB PMDs, hence 12MB. Increase the size to prevent this from happening. This may require further revision if folios get larger or fsdax starts supporting PMDs that are larger than 2MB. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner --- tests/xfs/166 | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/xfs/166 b/tests/xfs/166 index 42379961..d45dc5e8 100755 --- a/tests/xfs/166 +++ b/tests/xfs/166 @@ -16,12 +16,12 @@ _begin_fstest rw metadata auto quick # the others are unwritten. _filter_blocks() { - $AWK_PROG ' + $AWK_PROG -v file_size=$FILE_SIZE ' /^ +[0-9]/ { if (!written_size) { written_size = $6 - unwritten1 = ((1048576/512) / 2) - written_size - unwritten2 = ((1048576/512) / 2) - 2 * written_size + unwritten1 = ((file_size/512) / 2) - written_size + unwritten2 = ((file_size/512) / 2) - 2 * written_size } # is the extent unwritten? @@ -58,7 +58,18 @@ _scratch_mount TEST_FILE=$SCRATCH_MNT/test_file TEST_PROG=$here/src/unwritten_mmap -FILE_SIZE=1048576 + +# Beginning with 5.18, some filesystems support creating large folios for the +# page cache. A system with 64k pages can create 256k folios, which means +# that with the old file size of 1M, the last half of the file is completely +# converted from unwritten to written by page_mkwrite. The test will fail on +# the golden output when this happens, so increase the size from the original +# 1MB file size to at least (6 * 256k == 1.5MB) prevent this from happening. +# +# However, increasing the file size to around 2MB causes regressions when fsdax +# is enabled because fsdax will try to use PMD entries for the mappings. Hence +# we need to set the file size to (6 * 2MB == 12MB) to cover all cases. +FILE_SIZE=$((12 * 1048576)) rm -f $TEST_FILE $TEST_PROG $FILE_SIZE $TEST_FILE From patchwork Tue Jun 28 20:22:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 12898913 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 D83BCCCA479 for ; Tue, 28 Jun 2022 20:25:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233238AbiF1UZG (ORCPT ); Tue, 28 Jun 2022 16:25:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232893AbiF1UYr (ORCPT ); Tue, 28 Jun 2022 16:24:47 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EC2C3981F; Tue, 28 Jun 2022 13:22:11 -0700 (PDT) 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 C7297B8203F; Tue, 28 Jun 2022 20:22:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85D08C3411D; Tue, 28 Jun 2022 20:22:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656447728; bh=F+r3GkLBuLofHc4DvTbyjiDKmp/Zv65CClZbMwTM4KQ=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=faEmLy7DoE67qnFrjc3mtJ1FTLuCfkeTEuIyKV88EhS6LVuS4ZqX0kyae4sAu6xpS UYHoNHGIIdacuVXj4D0o4Ne0NIAE6hgEUiQocUIiwKFEtHJ7R18hwHkOeuHPjs++k7 d8fFibBhu43s+Pd0pdBrLOI3d/XUDyIYoMksMQXkve8kyoTyMbhGZdocx+k2+aePhn 14CB8162dK4rvBqUswntaqaSXkx5RjeWyU3FTeM3or/OE3gavTkpYDZVm3L00P5PJF yW7QHmdve2+tSF8RyNelCAcy57VAbESWmdyVFXpMRiVGmNzzzQunkC1/eruPwEYf5z FsJzARO+dfidg== Subject: [PATCH 9/9] xfs/547: fix problems with realtime From: "Darrick J. Wong" To: djwong@kernel.org, guaneryu@gmail.com, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me Date: Tue, 28 Jun 2022 13:22:08 -0700 Message-ID: <165644772810.1045534.14629047434325021582.stgit@magnolia> In-Reply-To: <165644767753.1045534.18231838177395571946.stgit@magnolia> References: <165644767753.1045534.18231838177395571946.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 needs to fragment the free space on the data device so that each block added to the attr fork gets its own mapping. If the test configuration sets up a rt device and rtinherit=1 on the root dir, the test will erroneously fragment space on the *realtime* volume. When this happens, attr fork allocations are contiguous and get merged into fewer than 10 extents and the test fails. Fix this test to force all allocations to be on the data device, and fix incorrect variable usage in the error messages. Signed-off-by: Darrick J. Wong --- tests/xfs/547 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/xfs/547 b/tests/xfs/547 index 9d4216ca..60121eb9 100755 --- a/tests/xfs/547 +++ b/tests/xfs/547 @@ -33,6 +33,10 @@ for nrext64 in 0 1; do >> $seqres.full _scratch_mount >> $seqres.full + # Force data device extents so that we can fragment the free space + # and force attr fork allocations to be non-contiguous + _xfs_force_bdev data $SCRATCH_MNT + bsize=$(_get_file_block_size $SCRATCH_MNT) testfile=$SCRATCH_MNT/testfile @@ -76,13 +80,15 @@ for nrext64 in 0 1; do acnt=$(_scratch_xfs_get_metadata_field core.naextents \ "path /$(basename $testfile)") - if (( $dcnt != 10 )); then - echo "Invalid data fork extent count: $dextcnt" + echo "nrext64: $nrext64 dcnt: $dcnt acnt: $acnt" >> $seqres.full + + if [ -z "$dcnt" ] || (( $dcnt != 10 )); then + echo "Invalid data fork extent count: $dcnt" exit 1 fi - if (( $acnt < 10 )); then - echo "Invalid attr fork extent count: $aextcnt" + if [ -z "$acnt" ] || (( $acnt < 10 )); then + echo "Invalid attr fork extent count: $acnt" exit 1 fi done