From patchwork Wed Mar 20 00:44:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10860607 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2ABC31669 for ; Wed, 20 Mar 2019 00:44:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0218B29992 for ; Wed, 20 Mar 2019 00:44:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EADEB29987; Wed, 20 Mar 2019 00:44:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1331288AC for ; Wed, 20 Mar 2019 00:44:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725958AbfCTAor (ORCPT ); Tue, 19 Mar 2019 20:44:47 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:57032 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726969AbfCTAor (ORCPT ); Tue, 19 Mar 2019 20:44:47 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2K0cuWi008321; Wed, 20 Mar 2019 00:44:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=Ty3EFyvRKIIqM1dtJqYIhu8XzQUwQaRuYYC4GC2/TyE=; b=YRnunkikXmwjes2V7NCKB14ZBYOzGgM6kmbU/kiYv517hISUaTChNatO6vJZYHoNow04 AK47/k7YynYUO7P3LMxJywn5h8xaSyzE5HTLIcoS43+7se2qA0T3vr+EeySLPkZH4Awt 74G5PePtZ5qaiHwgGTXZd9BD9+qlhFHCaOjUObfzLc2SZyLGW0EqATUGFCYkVfc9rCZ7 Aum/JDSVKS4t9V4epkPq2m6w+nWLmOLnScVvkPDBoI2V+g5scurXP2yzVVPAC2rfzrX1 t6snKWMClx4eULyD6urRW31i9UpqUu+KYBTtSG6ZdjvOqcudE7dMcWTo9b95ddGMJbzM 3w== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2130.oracle.com with ESMTP id 2r8pner3wb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:44:44 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x2K0igcb005274 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:44:43 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x2K0igjg022036; Wed, 20 Mar 2019 00:44:42 GMT Received: from localhost (/10.159.245.168) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 Mar 2019 17:44:42 -0700 Subject: [PATCH 01/12] check: improve test list randomization From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 19 Mar 2019 17:44:42 -0700 Message-ID: <155304268284.31707.10338119992472996728.stgit@magnolia> In-Reply-To: <155304267647.31707.14180452399822113095.stgit@magnolia> References: <155304267647.31707.14180452399822113095.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9200 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=913 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903200003 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong awk doesn't have a particularly good random number generator -- it seeds from the Unix epoch time in seconds, which means that the run order across a bunch of VMs started at exactly the same time are unsettlingly predictable. Therefore, at least try to seed it with bash's $RANDOM, which is slightly less predictable. Signed-off-by: Darrick J. Wong --- check | 12 ++++++------ randomize.awk | 12 ++++++++---- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/check b/check index 20e95302..ecd1d39a 100755 --- a/check +++ b/check @@ -242,13 +242,13 @@ _prepare_test_list() done # sort the list of tests into numeric order - list=`sort -n $tmp.list | uniq` - rm -f $tmp.list - - if $randomize - then - list=`echo $list | awk -f randomize.awk` + if $randomize; then + sorter="awk -v seed=$RANDOM -f randomize.awk" + else + sorter="cat" fi + list=`sort -n $tmp.list | uniq | $sorter` + rm -f $tmp.list } # Process command arguments first. diff --git a/randomize.awk b/randomize.awk index 0a8ad71a..d979fb03 100644 --- a/randomize.awk +++ b/randomize.awk @@ -15,10 +15,14 @@ function randomize(array, N) { return } +BEGIN { + srand(seed) +} { - srand() - for (i = 0; i < NF; i++ ) array[i] = $(i+1) - randomize(array, NF) - for (i = 0; i < NF; i++) printf("%s ", array[i]) + array[NR - 1] = $0 +} +END { + randomize(array, NR) + for (i = 0; i < NR; i++) printf("%s ", array[i]) } From patchwork Wed Mar 20 00:44:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10860609 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 95D861669 for ; Wed, 20 Mar 2019 00:44:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8454C288AC for ; Wed, 20 Mar 2019 00:44:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 78ADB29990; Wed, 20 Mar 2019 00:44:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38D86288AC for ; Wed, 20 Mar 2019 00:44:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727388AbfCTAow (ORCPT ); Tue, 19 Mar 2019 20:44:52 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:57096 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726969AbfCTAow (ORCPT ); Tue, 19 Mar 2019 20:44:52 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2K0crv1008307; Wed, 20 Mar 2019 00:44:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=4QcHAOVrcakXX/EXLdKSmdiDx4DvRguz2z3xlKuIZPY=; b=WWJDC9joUFCVDMd4KIsV52TMhPHsWFuY3sRlu3uloovacCFFf6SW+GIAPYddZ7ME/bsD TYMduBGPSUQhZrAj2czd/x4Bl57qFzNANKUq/bJnjWU0wKMRQfx3/O4IVjkc25er3WF3 xcIZxuAyChCKgJ7EstW724cgjI44HAKuBSUvkAm0BrlTfJ54TFMjwf7usL8atukOxSkh 5lwCtZgv02re900by9dixkdvwB7cna2v9q2k/+0aMHNRBiV5Qr8TPHFQ6kJzsA98+oEb tA64xgbwJjatfij2QNU/Qp+L0BrammxD176j/LNGa6i0n2soCFt8yxWzff1KFAJkF38I 6w== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2130.oracle.com with ESMTP id 2r8pner3wg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:44:50 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x2K0inDs019440 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:44:49 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x2K0inqX003665; Wed, 20 Mar 2019 00:44:49 GMT Received: from localhost (/10.159.245.168) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 Mar 2019 17:44:48 -0700 Subject: [PATCH 02/12] check: really improve test list randomization From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 19 Mar 2019 17:44:49 -0700 Message-ID: <155304268908.31707.9639554348139720057.stgit@magnolia> In-Reply-To: <155304267647.31707.14180452399822113095.stgit@magnolia> References: <155304267647.31707.14180452399822113095.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9200 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=940 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903200003 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong coreutils provides the shuf(1) utility that randomizes the order of a list and seeds its random number generator with /dev/urandom. It's a bit speedier than awk, so use it if available. Signed-off-by: Darrick J. Wong --- check | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/check b/check index ecd1d39a..a2c5ba21 100755 --- a/check +++ b/check @@ -243,7 +243,11 @@ _prepare_test_list() # sort the list of tests into numeric order if $randomize; then - sorter="awk -v seed=$RANDOM -f randomize.awk" + if type shuf >& /dev/null; then + sorter="shuf" + else + sorter="awk -v seed=$RANDOM -f randomize.awk" + fi else sorter="cat" fi From patchwork Wed Mar 20 00:44:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10860615 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6E65D1669 for ; Wed, 20 Mar 2019 00:44:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 514D029992 for ; Wed, 20 Mar 2019 00:44:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 456A62998C; Wed, 20 Mar 2019 00:44:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 013A6288AC for ; Wed, 20 Mar 2019 00:44:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727389AbfCTAo6 (ORCPT ); Tue, 19 Mar 2019 20:44:58 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:39800 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726969AbfCTAo6 (ORCPT ); Tue, 19 Mar 2019 20:44:58 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2K0dFTc175206; Wed, 20 Mar 2019 00:44:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=oM2Ud+hRfV15fpiLyPsFegWW1yejKM12/LYm0CffAwk=; b=EiuATILPlAA1nb2EY/7+ndEq+OO5dusxB438iVrZeH6RrVGezVsEkePDik9IXytyvGza 2I+Ky8G1NLGTwbg2rAMoxAmNAWJBynqaXyex8dr4WA3leY/Ja9rH+KkR+gUBpHx5sfzQ Ke6GE1hZJT/7xap8RTa7iMP3brLzbZWgFdmzRXLEZBT2nNaNnmm/e/EOEfNNrVq/8FqM F/qctL1tvvBaokEB9iytmoEV4eZ1edrex/PgqOAyIVmCOfW/zo1Av2YLycgalQTEekZ9 KXY5xJUFT2Bw/ErDqKmPtL/tmtVBn4BMQkM7kNJKar3q7Gb0MlDFrOOHVqz3JFTpCWpv FQ== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2r8ssrfsd3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:44:56 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x2K0itUb019585 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:44:55 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x2K0itRK006514; Wed, 20 Mar 2019 00:44:55 GMT Received: from localhost (/10.159.245.168) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 Mar 2019 17:44:55 -0700 Subject: [PATCH 03/12] generic/042: fix stale disk contents check From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 19 Mar 2019 17:44:55 -0700 Message-ID: <155304269533.31707.10962791945845709289.stgit@magnolia> In-Reply-To: <155304267647.31707.14180452399822113095.stgit@magnolia> References: <155304267647.31707.14180452399822113095.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9200 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903200003 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong This test doesn't call fsync or sync to force writeback of the first 60k of the file, which means that we could end up with a file full of zeroes or an empty file. Since this is a regression test that looks for stale disk contents slipping through, change the test to look for the stale bytes. Signed-off-by: Darrick J. Wong --- tests/generic/042 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/generic/042 b/tests/generic/042 index 1aa18f9b..6c62eb63 100755 --- a/tests/generic/042 +++ b/tests/generic/042 @@ -44,7 +44,7 @@ _crashtest() # Create an fs on a small, initialized image. The pattern is written to # the image to detect stale data exposure. - $XFS_IO_PROG -f -c "truncate 0" -c "pwrite 0 25M" $img \ + $XFS_IO_PROG -f -c "truncate 0" -c "pwrite -S 0xCD 0 25M" $img \ >> $seqres.full 2>&1 _mkfs_dev $img >> $seqres.full 2>&1 @@ -61,8 +61,12 @@ _crashtest() $UMOUNT_PROG $mnt _mount $img $mnt - # we generally expect a zero-sized file (this should be silent) - hexdump $file + # We should /never/ see 0xCD in the file, because we wrote that pattern + # to the filesystem image to expose stale data. + if hexdump -v -e '/1 "%02X "' $file | grep -q "CD"; then + echo "Saw stale data!!!" + hexdump $file + fi $UMOUNT_PROG $mnt } From patchwork Wed Mar 20 00:45:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10860619 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4E7F21669 for ; Wed, 20 Mar 2019 00:45:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C0EF288AC for ; Wed, 20 Mar 2019 00:45:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 307FC2998D; Wed, 20 Mar 2019 00:45:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC20D288AC for ; Wed, 20 Mar 2019 00:45:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727395AbfCTApF (ORCPT ); Tue, 19 Mar 2019 20:45:05 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:57194 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726969AbfCTApF (ORCPT ); Tue, 19 Mar 2019 20:45:05 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2K0cYIP008235; Wed, 20 Mar 2019 00:45:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=bDQwWzZNhJt6dClJIdd269bZOBf0vrFVHuzsc5VzPPc=; b=qcph92gyvs5uTqKRBn65xckC8kgpDxAcvAzChkHzUy/GBLMPn0s6Zenw/hs9lNL7aUEo l1bWk706gG8JF0d4XIVAEgGuP5ffqtaycP5A57wpC57SVm3nuM7QxAi+cwZYXUfPPtKs 1/q9JBUYnep3+5Sf9NIghpq8lBFs+mb0OoDeV1bvXexnMF57tirNp36ywUqDNdJAZxQq soO10Y8f8cPqQlXMQvteICDLDH7PwefmE3qx5ckH1qEHu+jFhvN9QuUGFffu8HUhPb/j 5g3HcgMmXskLOLOrC/65BBY/0sv+Jr7/Gbwn4KNsB/pQxvO9S7MJZ5GHJFhNO6CvAPGz HQ== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2r8pner3x1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:45:02 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x2K0j2Lv014652 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:45:02 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x2K0j1DT006802; Wed, 20 Mar 2019 00:45:01 GMT Received: from localhost (/10.159.245.168) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 Mar 2019 17:45:01 -0700 Subject: [PATCH 04/12] generic/032: fix unwritten extent checks From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 19 Mar 2019 17:45:01 -0700 Message-ID: <155304270155.31707.5574383689968895450.stgit@magnolia> In-Reply-To: <155304267647.31707.14180452399822113095.stgit@magnolia> References: <155304267647.31707.14180452399822113095.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9200 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903200003 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong Fix the unwritten extent detector in this test to ignore post-eof allocations because those are harmless. Signed-off-by: Darrick J. Wong --- tests/generic/032 | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/generic/032 b/tests/generic/032 index affde4b7..38352a21 100755 --- a/tests/generic/032 +++ b/tests/generic/032 @@ -69,18 +69,21 @@ do # preallocate the first 64k and overwite, writing past 64k to contend # with writeback + file_len=0x100000 $XFS_IO_PROG \ -c "falloc 0 0x10000" \ - -c "pwrite 0 0x100000" \ + -c "pwrite 0 $file_len" \ -c "fsync" \ $SCRATCH_MNT/file >> $seqres.full 2>&1 - # Check for unwritten extents. We should have none since we wrote over - # the entire preallocated region and ran fsync. - $XFS_IO_PROG -c "fiemap -v" $SCRATCH_MNT/file | \ - tee -a $seqres.full | \ - _filter_fiemap | grep unwritten - [ $? == 0 ] && _fail "Unwritten extents found!" + # Check for unwritten extents. We should have none before EOF since we + # wrote over the entire preallocated region and ran fsync. + eof_sector=$(( file_len / 512 )) + $XFS_IO_PROG -c 'fiemap -v' $SCRATCH_MNT/file | \ + _filter_fiemap | \ + tr '[.]:' ' ' | \ + awk "{if (\$2 < $eof_sector) {print \$0}}" | \ + grep -q unwritten && _fail "Unwritten extents found!" done echo $iters iterations From patchwork Wed Mar 20 00:45:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10860621 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B479A1669 for ; Wed, 20 Mar 2019 00:45:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A01BB29990 for ; Wed, 20 Mar 2019 00:45:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93BFB288AC; Wed, 20 Mar 2019 00:45:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4AEFA288AC for ; Wed, 20 Mar 2019 00:45:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727062AbfCTApU (ORCPT ); Tue, 19 Mar 2019 20:45:20 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:52174 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726875AbfCTApT (ORCPT ); Tue, 19 Mar 2019 20:45:19 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2K0cSVt167920; Wed, 20 Mar 2019 00:45:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=Rc2Iwsprgjg0Rtahi7esLVLEtvuVzDmzB83WPglIkWU=; b=hIBv3zc0bQwYcJXQwJSn9pGenXSv3AL0LbKBrDiHaH5rNL+fRV7V312vlvAhJlEroKNm J4UFynhwjfYn9hGV1oLcibyuoi0J3H34C+L1YJSZrHHOdfQ+z6m8ZOfcvZMMRDs7VXSd fJgv/bJyXAXQgGnsPSLSc6/4HR00WYqEY9BdMAX2PeFDmJgdx0v1QVVyVUevADpeob5M Dr5kqTywnb2Tx7GEToU/AzpQgDWCA0Be8VEzdqeWkFTLGyk+raIQmOuejVUzl/eonlq8 pASHn4exug6n20qLTYrz5z2BOsdg1QjLUlpSw4m9kswJ0rCeYejBsxBd4HQKIh7kAqYE YQ== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2r8rjuqwww-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:45:17 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x2K0jGO6016114 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:45:16 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x2K0jGit007069; Wed, 20 Mar 2019 00:45:16 GMT Received: from localhost (/10.159.245.168) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 Mar 2019 17:45:15 -0700 Subject: [PATCH 05/12] generic/454: stop the test if we run out of space From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 19 Mar 2019 17:45:07 -0700 Message-ID: <155304270779.31707.9419680484243839398.stgit@magnolia> In-Reply-To: <155304267647.31707.14180452399822113095.stgit@magnolia> References: <155304267647.31707.14180452399822113095.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9200 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903200003 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong Certain filesystems (ext4 w/ 1k block size) can run out of space while running this test because they have very limited xattr storage capabilities. If we run out of space while setting an attr, don't bother continuing the test. Signed-off-by: Darrick J. Wong --- tests/generic/454 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/generic/454 b/tests/generic/454 index 4a0936c5..01986d6b 100755 --- a/tests/generic/454 +++ b/tests/generic/454 @@ -48,7 +48,12 @@ setf() { key="$(echo -e "$1")" value="$2" - $SETFATTR_PROG -n "user.${key}" -v "${value}" "${testfile}" + $SETFATTR_PROG -n "user.${key}" -v "${value}" "${testfile}" > $tmp.output 2>&1 + if [ $? -ne 0 ]; then + grep -q 'No space left on device' $tmp.output && \ + _notrun "ran out of space" + cat $tmp.output + fi echo "Storing ${key} ($(hexbytes "${key}")) -> ${value}" >> $seqres.full } From patchwork Wed Mar 20 00:45:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10860627 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 03EC91515 for ; Wed, 20 Mar 2019 00:45:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF50129999 for ; Wed, 20 Mar 2019 00:45:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D3DD52998D; Wed, 20 Mar 2019 00:45:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 956232998C for ; Wed, 20 Mar 2019 00:45:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726875AbfCTAp0 (ORCPT ); Tue, 19 Mar 2019 20:45:26 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:52248 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726801AbfCTAp0 (ORCPT ); Tue, 19 Mar 2019 20:45:26 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2K0deiT168935; Wed, 20 Mar 2019 00:45:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=fM1si7qSp88X9be85lGZ6DUE7sLgUwWNQWMQVzQgVck=; b=4P1NTaxOvNMj4XNOhE4jk6kcjr9XIRq9h0XZQ+zW+//6C3uvm1Nwve4TAhyTpIJtrkwK sX8e4KYDZ2G+c8lU114OI/LUx3SwENSuHOOtEyWSqcHxNRHQRBz7aNncjTDGIHL/8g1C SSj1WNbLCtACHEHJQ34mtEkHzfhxrz5nyNrhuOKUcRbqesKYrzDXLj7zYvaTRJ3H2i7T rppEk/BmfIHTxYSe2dlsQQW/ZG/7H4bsDT5UxVyzI93SL3Vsg3ud6VFl4t8eQNeVyxfQ 9/EpVVE5ME/3ekuMTnqLCEi26zCXohUU7c5OgGW8DogCXzOQVHIiW1S7wUllasCJRIf4 DA== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2r8rjuqwx4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:45:24 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x2K0jM1w016294 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:45:23 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x2K0jMHk027247; Wed, 20 Mar 2019 00:45:22 GMT Received: from localhost (/10.159.245.168) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 Mar 2019 17:45:22 -0700 Subject: [PATCH 06/12] ext4/023: don't require scrub for ext4 populated image creation From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 19 Mar 2019 17:45:22 -0700 Message-ID: <155304272254.31707.3761494827323670805.stgit@magnolia> In-Reply-To: <155304267647.31707.14180452399822113095.stgit@magnolia> References: <155304267647.31707.14180452399822113095.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9200 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=792 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903200003 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong Don't require scrub for ext4's populated fs creation test because there is no general online scrub program for ext*. Signed-off-by: Darrick J. Wong --- tests/ext4/023 | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/ext4/023 b/tests/ext4/023 index a598e2b4..1dadb29f 100755 --- a/tests/ext4/023 +++ b/tests/ext4/023 @@ -33,7 +33,6 @@ _cleanup() _supported_os Linux _supported_fs ext4 _require_scratch -_require_scrub echo "Format and populate" _scratch_populate_cached > $seqres.full 2>&1 From patchwork Wed Mar 20 00:45:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10860631 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 047831669 for ; Wed, 20 Mar 2019 00:45:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E6B9329987 for ; Wed, 20 Mar 2019 00:45:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DAC4A2998C; Wed, 20 Mar 2019 00:45:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81E002998B for ; Wed, 20 Mar 2019 00:45:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727406AbfCTApd (ORCPT ); Tue, 19 Mar 2019 20:45:33 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:57502 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726801AbfCTApc (ORCPT ); Tue, 19 Mar 2019 20:45:32 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2K0cZXw008238; Wed, 20 Mar 2019 00:45:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=NJUDaziGzizIgoo3DtBlDSMt5SGjPsgwp5P2meRz59M=; b=r7YZ8PM0ce9D/2sGah3nPdzoPGxrgUFOi/8pxJO35KQcK/+F78JerQheYN/aj9rfiIPV hS9eLQgSy8tSHneUaBray1tnszv7WOAud5yF9BGoWkSeYP+RJkxEO/ymufe6zocWkp/N bWIe8L4jzkheCSAx6NOcFCH0DlbtyD3ZAT4sg+ZhqBuYAXJl5r7GT7Pu4IJnLJOHnLBG WRoBbgLxclixbfpEXKmFD8sVkDnbj4GcsFfQpky+ygIQW8POKsPSB2AneCsr51SE/Ctx 4x9FLYoCPyKtbJlaBZKH+lHY6+cxWDbphx81x91mBTGsVnmlQRDiSithNJN/5AgpXS/T uw== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2r8pner3yr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:45:29 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x2K0jTxd016701 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:45:29 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x2K0jShD027305; Wed, 20 Mar 2019 00:45:28 GMT Received: from localhost (/10.159.245.168) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 Mar 2019 17:45:28 -0700 Subject: [PATCH 07/12] common/populate: refactor _scratch_populate_cached From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 19 Mar 2019 17:45:28 -0700 Message-ID: <155304272879.31707.4358538241141797662.stgit@magnolia> In-Reply-To: <155304267647.31707.14180452399822113095.stgit@magnolia> References: <155304267647.31707.14180452399822113095.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9200 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903200003 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong Refactor _scratch_populate_cached into smaller helper functions. Signed-off-by: Darrick J. Wong --- common/populate | 69 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 26 deletions(-) diff --git a/common/populate b/common/populate index 95953476..1f921ac5 100644 --- a/common/populate +++ b/common/populate @@ -765,20 +765,14 @@ _fill_fs() done } -# Populate a scratch FS from scratch or from a cached image. -_scratch_populate_cached() { - POPULATE_METADUMP="${TEST_DIR}/__populate.${FSTYP}" - POPULATE_METADUMP_DESCR="${TEST_DIR}/__populate.${FSTYP}.txt" - - # Don't keep metadata images cached for more 48 hours... - rm -rf "$(find "${POPULATE_METADUMP}" -mtime +2 2>/dev/null)" +# Compute the fs geometry description of a populated filesystem +_scratch_populate_cache_tag() { + local extra_descr="" + local size="$(blockdev --getsz "${SCRATCH_DEV}")" - # Throw away cached image if it doesn't match our spec. case "${FSTYP}" in "ext4") extra_descr="LOGDEV ${SCRATCH_LOGDEV} USE_EXTERNAL ${USE_EXTERNAL}" - # ext4 cannot e2image external logs, so we cannot restore - test -n "${SCRATCH_LOGDEV}" && rm -f "${POPULATE_METADUMP}" ;; "xfs") extra_descr="LOGDEV ${SCRATCH_LOGDEV} USE_EXTERNAL ${USE_EXTERNAL} RTDEV ${SCRATCH_RTDEV}" @@ -787,23 +781,46 @@ _scratch_populate_cached() { extra_descr="${extra_descr} QUOTAS" fi ;; - *) - extra_descr="";; esac - meta_descr="FSTYP ${FSTYP} MKFS_OPTIONS ${MKFS_OPTIONS} SIZE $(blockdev --getsz "${SCRATCH_DEV}") ${extra_descr} ARGS $@" - cmp -s "${POPULATE_METADUMP_DESCR}" <(echo "${meta_descr}") || rm -rf "${POPULATE_METADUMP}" - - # Do we have a cached image? - if [ -r "${POPULATE_METADUMP}" ]; then - case "${FSTYP}" in - "xfs") - xfs_mdrestore "${POPULATE_METADUMP}" "${SCRATCH_DEV}" && return - ;; - "ext2"|"ext3"|"ext4") - e2image -r "${POPULATE_METADUMP}" "${SCRATCH_DEV}" && return - ;; - esac - fi + echo "FSTYP ${FSTYP} MKFS_OPTIONS ${MKFS_OPTIONS} SIZE ${size} ${extra_descr} ARGS $@" +} + +# Restore a cached populated fs from a metadata dump +_scratch_populate_restore_cached() { + local metadump="$1" + + case "${FSTYP}" in + "xfs") + xfs_mdrestore "${metadump}" "${SCRATCH_DEV}" && return 0 + ;; + "ext2"|"ext3"|"ext4") + # ext4 cannot e2image external logs, so we cannot restore + test -n "${SCRATCH_LOGDEV}" && return 1 + e2image -r "${metadump}" "${SCRATCH_DEV}" && return 0 + ;; + esac + return 1 +} + +# Populate a scratch FS from scratch or from a cached image. +_scratch_populate_cached() { + local meta_descr="$(_scratch_populate_cache_tag "$@")" + + # These variables are shared outside this function + POPULATE_METADUMP="${TEST_DIR}/__populate.${FSTYP}" + POPULATE_METADUMP_DESCR="${TEST_DIR}/__populate.${FSTYP}.txt" + + # Don't keep metadata images cached for more 48 hours... + rm -rf "$(find "${POPULATE_METADUMP}" -mtime +2 2>/dev/null)" + + # Throw away cached image if it doesn't match our spec. + cmp -s "${POPULATE_METADUMP_DESCR}" <(echo "${meta_descr}") || \ + rm -rf "${POPULATE_METADUMP}" + + # Try to restore from the metadump + test -r "${POPULATE_METADUMP}" && \ + _scratch_populate_restore_cached "${POPULATE_METADUMP}" && \ + return # Oh well, just create one from scratch _scratch_mkfs From patchwork Wed Mar 20 00:45:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10860633 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 353051669 for ; Wed, 20 Mar 2019 00:45:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1990729997 for ; Wed, 20 Mar 2019 00:45:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0DD9029990; Wed, 20 Mar 2019 00:45:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD7D72998B for ; Wed, 20 Mar 2019 00:45:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726896AbfCTApn (ORCPT ); Tue, 19 Mar 2019 20:45:43 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:52432 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726835AbfCTApn (ORCPT ); Tue, 19 Mar 2019 20:45:43 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2K0d6K9168031; Wed, 20 Mar 2019 00:45:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=zXhbPM1HqhBgeSPU+ubmDFnyQnCENqOBitAdTlBpVww=; b=SXoQ0zlE+F5J03mDOHnSbung6xpwlLqhnztMa+7rT0WFH/33+Hjeo4y0btAuN2rLkB9U cQoFCaYLFDGwRUTByeuUnvca1PBYDAmxP6xklyrtoFUWQeDiLJsVwZDAYBAut1qLQXQj XToF0OPTuZNI96IfSAQ6a9pSkxDbn+3+2Ngd3T2GnSVuL0CJSO/b9tEftciWfop+dR6/ S/cQNw1IvpD823Eu+g/r8f6wrOdxsK1IVfRWC3bv8PHoLrmdhy1bgIXHbZR+8cdro1zs pHn6fr5EJVHLNUIILpsvDlpbRJpPpaF7rcw0yXdNlqrZgpvoK0WP8FFv97JJkEleOtU7 Fw== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2r8rjuqwxn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:45:41 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x2K0jZOV016736 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:45:35 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x2K0jZsa004199; Wed, 20 Mar 2019 00:45:35 GMT Received: from localhost (/10.159.245.168) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 Mar 2019 17:45:34 -0700 Subject: [PATCH 08/12] common/populate: support multiple cached images From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 19 Mar 2019 17:45:35 -0700 Message-ID: <155304273502.31707.11442947133103113710.stgit@magnolia> In-Reply-To: <155304267647.31707.14180452399822113095.stgit@magnolia> References: <155304267647.31707.14180452399822113095.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9200 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903200003 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong Enhance the populated fs metadump image cache to support multiple configurations per filesystem so that we reduce the image creation overhead even further. Signed-off-by: Darrick J. Wong --- common/populate | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/populate b/common/populate index 1f921ac5..4fa118f0 100644 --- a/common/populate +++ b/common/populate @@ -805,10 +805,12 @@ _scratch_populate_restore_cached() { # Populate a scratch FS from scratch or from a cached image. _scratch_populate_cached() { local meta_descr="$(_scratch_populate_cache_tag "$@")" + local meta_tag="$(echo "${meta_descr}" | md5sum - | cut -d ' ' -f 1)" + local metadump_stem="${TEST_DIR}/__populate.${FSTYP}.${meta_tag}" # These variables are shared outside this function - POPULATE_METADUMP="${TEST_DIR}/__populate.${FSTYP}" - POPULATE_METADUMP_DESCR="${TEST_DIR}/__populate.${FSTYP}.txt" + POPULATE_METADUMP="${metadump_stem}.metadump" + POPULATE_METADUMP_DESCR="${metadump_stem}.txt" # Don't keep metadata images cached for more 48 hours... rm -rf "$(find "${POPULATE_METADUMP}" -mtime +2 2>/dev/null)" From patchwork Wed Mar 20 00:45:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10860639 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DAB341669 for ; Wed, 20 Mar 2019 00:45:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C08E92998B for ; Wed, 20 Mar 2019 00:45:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B538829999; Wed, 20 Mar 2019 00:45:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44AD52998B for ; Wed, 20 Mar 2019 00:45:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726969AbfCTAps (ORCPT ); Tue, 19 Mar 2019 20:45:48 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:57646 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725958AbfCTAps (ORCPT ); Tue, 19 Mar 2019 20:45:48 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2K0d0Uj008333; Wed, 20 Mar 2019 00:45:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=+E5AjJpBvziNlObLgN2TMnUdRjKdmQbTctmnr1T0FWU=; b=pZo+wUKzEkR34H+uUE7RDUznGWh5azA1IUKMZ0r320kfaM+EGKKOkwqAMkPxgQWg17QB WlUcVVZC45YiXByg5rq9HsK3CGejuGUWRtzQNrATHIdvX2+Vh1dK5lfjHnQg68aZIEuU hH7LSmITVEI7FyF2aNNX8qZjRPdIIdYzky37f86hQkvOXsfoAFhl6AMOvQ1pOmeHod5n /pdTnfjmzfTeeiPfVPbVN56rp9J6hfaMD105NvLgHdFbNHSKxo6+peGMtJ+1Sf93PmRV 4M+vCGFKZaOA069sfHIQHMnALBoE/RYT3ju1S3kLkr0HiU5ygnVmTnlpXRpFSSLTlz0J RA== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2r8pner404-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:45:43 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x2K0jhn8016951 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:45:43 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x2K0jgm5022532; Wed, 20 Mar 2019 00:45:42 GMT Received: from localhost (/10.159.245.168) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 Mar 2019 17:45:41 -0700 Subject: [PATCH 09/12] clonerange: test remapping the rainbow From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 19 Mar 2019 17:45:41 -0700 Message-ID: <155304274130.31707.14030747488293662594.stgit@magnolia> In-Reply-To: <155304267647.31707.14180452399822113095.stgit@magnolia> References: <155304267647.31707.14180452399822113095.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9200 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903200003 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong Add some more clone range tests that missed various "wacky" combinations of file state. Specifically, we test reflinking into and out of rainbow ranges (a mix of real, unwritten, hole, delalloc, and shared extents), and also we test that we can correctly handle double-inode locking no matter what order of inodes or the filesystem's locking rules. Signed-off-by: Darrick J. Wong --- common/reflink | 7 ++ tests/generic/940 | 94 ++++++++++++++++++++++++ tests/generic/940.out | 14 ++++ tests/generic/941 | 99 +++++++++++++++++++++++++ tests/generic/941.out | 16 ++++ tests/generic/942 | 95 ++++++++++++++++++++++++ tests/generic/942.out | 14 ++++ tests/generic/943 | 99 +++++++++++++++++++++++++ tests/generic/943.out | 16 ++++ tests/generic/944 | 196 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/944.out | 62 ++++++++++++++++ tests/generic/group | 5 + 12 files changed, 716 insertions(+), 1 deletion(-) create mode 100755 tests/generic/940 create mode 100644 tests/generic/940.out create mode 100755 tests/generic/941 create mode 100644 tests/generic/941.out create mode 100755 tests/generic/942 create mode 100644 tests/generic/942.out create mode 100755 tests/generic/943 create mode 100644 tests/generic/943.out create mode 100755 tests/generic/944 create mode 100644 tests/generic/944.out diff --git a/common/reflink b/common/reflink index 11561a76..598f0877 100644 --- a/common/reflink +++ b/common/reflink @@ -14,9 +14,14 @@ _require_cp_reflink() # Can we reflink between arbitrary file sets? # i.e. if we reflink a->b and c->d, can we later share # blocks between b & c? +_supports_arbitrary_fileset_reflink() +{ + test "$FSTYP" != "ocfs2" +} + _require_arbitrary_fileset_reflink() { - test "$FSTYP" = "ocfs2" && \ + _supports_arbitrary_fileset_reflink || _notrun "reflink between arbitrary file groups not supported in $FSTYP" } diff --git a/tests/generic/940 b/tests/generic/940 new file mode 100755 index 00000000..4573cbae --- /dev/null +++ b/tests/generic/940 @@ -0,0 +1,94 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2019, Oracle and/or its affiliates. All Rights Reserved. +# +# FS QA Test No. 940 +# +# Ensuring that reflinking works when the destination range covers multiple +# extents, some unwritten, some not: +# +# - Create a file with the following repeating sequence of blocks: +# 1. reflinked +# 2. unwritten +# 3. hole +# 4. regular block +# 5. delalloc +# - reflink across the halfway mark, starting with the unwritten extent. +# - Check that the files are now different where we say they're different. +# +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* $testdir +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" +_require_xfs_io_command "fpunch" +_require_cp_reflink +_require_odirect + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +_pwrite_byte 0x64 0 $((blksz * nr)) $testdir/file2 >> $seqres.full +_weave_reflink_rainbow $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_cycle_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +echo "reflink across the transition" +roff=$((filesize / 4)) +rsz=$((filesize / 2)) +_weave_reflink_rainbow_delalloc $blksz $nr $testdir/file3 >> $seqres.full + +# now reflink into the rainbow +echo "before reflink" >> $seqres.full +$FILEFRAG_PROG -v $testdir/file2 >> $seqres.full +$FILEFRAG_PROG -v $testdir/file3 >> $seqres.full +$XFS_IO_PROG -f -c "reflink $testdir/file2 $roff $roff $rsz" $testdir/file3 >> $seqres.full +_pwrite_byte 0x64 $roff $rsz $testdir/file3.chk >> $seqres.full +_scratch_cycle_mount + +echo "Compare files" +echo "after reflink" >> $seqres.full +$FILEFRAG_PROG -v $testdir/file2 >> $seqres.full +$FILEFRAG_PROG -v $testdir/file3 >> $seqres.full +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/generic/940.out b/tests/generic/940.out new file mode 100644 index 00000000..d34c7b50 --- /dev/null +++ b/tests/generic/940.out @@ -0,0 +1,14 @@ +QA output created by 940 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-940/file1 +5a5221017d3ab8fd7583312a14d2ba80 SCRATCH_MNT/test-940/file2 +6366fd359371414186688a0ef6988893 SCRATCH_MNT/test-940/file3 +6366fd359371414186688a0ef6988893 SCRATCH_MNT/test-940/file3.chk +reflink across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-940/file1 +5a5221017d3ab8fd7583312a14d2ba80 SCRATCH_MNT/test-940/file2 +5d47954e2336b2547afde6e44d2f13cc SCRATCH_MNT/test-940/file3 +5d47954e2336b2547afde6e44d2f13cc SCRATCH_MNT/test-940/file3.chk diff --git a/tests/generic/941 b/tests/generic/941 new file mode 100755 index 00000000..145b8585 --- /dev/null +++ b/tests/generic/941 @@ -0,0 +1,99 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2019, Oracle and/or its affiliates. All Rights Reserved. +# +# FS QA Test No. 941 +# +# Ensuring that reflinking works when the source range covers multiple +# extents, some unwritten, some not: +# +# - Create a file with the following repeating sequence of blocks: +# 1. reflinked +# 2. unwritten +# 3. hole +# 4. regular block +# 5. delalloc +# - reflink across the halfway mark, starting with the unwritten extent. +# - Check that the files are now different where we say they're different. +# +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* $testdir +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" +_require_xfs_io_command "fpunch" +_require_cp_reflink +_require_odirect + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +_pwrite_byte 0x64 0 $((blksz * nr)) $testdir/file2 >> $seqres.full +_pwrite_byte 0x64 0 $((blksz * nr)) $testdir/file2.chk >> $seqres.full +_weave_reflink_rainbow $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_cycle_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +echo "reflink across the transition" +roff=$((filesize / 4)) +rsz=$((filesize / 2)) +_weave_reflink_rainbow_delalloc $blksz $nr $testdir/file3 >> $seqres.full + +# now reflink the rainbow +echo "before reflink" >> $seqres.full +$FILEFRAG_PROG -v $testdir/file2 >> $seqres.full +$FILEFRAG_PROG -v $testdir/file3 >> $seqres.full +$XFS_IO_PROG -f -c "reflink $testdir/file3 $roff $roff $rsz" $testdir/file2 >> $seqres.full +cp $testdir/file3.chk $testdir/file2.chk +_pwrite_byte 0x64 0 $roff $testdir/file2.chk >> $seqres.full +_pwrite_byte 0x64 $((roff + rsz)) $((filesize - (roff + rsz) )) $testdir/file2.chk >> $seqres.full +_scratch_cycle_mount + +echo "Compare files" +echo "after reflink" >> $seqres.full +$FILEFRAG_PROG -v $testdir/file2 >> $seqres.full +$FILEFRAG_PROG -v $testdir/file3 >> $seqres.full +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/generic/941.out b/tests/generic/941.out new file mode 100644 index 00000000..a76e6c62 --- /dev/null +++ b/tests/generic/941.out @@ -0,0 +1,16 @@ +QA output created by 941 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-941/file1 +5a5221017d3ab8fd7583312a14d2ba80 SCRATCH_MNT/test-941/file2 +5a5221017d3ab8fd7583312a14d2ba80 SCRATCH_MNT/test-941/file2.chk +6366fd359371414186688a0ef6988893 SCRATCH_MNT/test-941/file3 +6366fd359371414186688a0ef6988893 SCRATCH_MNT/test-941/file3.chk +reflink across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-941/file1 +51a300aae3a4b4eaa023876a397e01ef SCRATCH_MNT/test-941/file2 +51a300aae3a4b4eaa023876a397e01ef SCRATCH_MNT/test-941/file2.chk +7bf7a779a0a54647b41753206c5218b1 SCRATCH_MNT/test-941/file3 +7bf7a779a0a54647b41753206c5218b1 SCRATCH_MNT/test-941/file3.chk diff --git a/tests/generic/942 b/tests/generic/942 new file mode 100755 index 00000000..92b0f298 --- /dev/null +++ b/tests/generic/942 @@ -0,0 +1,95 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2019, Oracle and/or its affiliates. All Rights Reserved. +# +# FS QA Test No. 942 +# +# Ensuring that reflinking works when the destination range covers multiple +# extents, some unwritten, some not: +# +# - Create a file with the following repeating sequence of blocks: +# 1. reflinked +# 2. unwritten +# 3. hole +# 4. regular block +# 5. delalloc +# - reflink across the halfway mark, starting with the unwritten extent. +# - Check that the files are now different where we say they're different. +# +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* $testdir +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" +_require_xfs_io_command "fpunch" +_require_cp_reflink +_require_odirect + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +_pwrite_byte 0x64 0 $((blksz * nr)) $testdir/file2 >> $seqres.full +_weave_reflink_rainbow $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_cycle_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +echo "reflink across the transition" +soff=$((filesize / 4)) +doff=$((filesize / 2)) +rsz=$((filesize / 2)) +_weave_reflink_rainbow_delalloc $blksz $nr $testdir/file3 >> $seqres.full + +# now reflink into the rainbow +echo "before reflink" >> $seqres.full +$FILEFRAG_PROG -v $testdir/file2 >> $seqres.full +$FILEFRAG_PROG -v $testdir/file3 >> $seqres.full +$XFS_IO_PROG -f -c "reflink $testdir/file2 $soff $doff $rsz" $testdir/file3 >> $seqres.full +_pwrite_byte 0x64 $doff $rsz $testdir/file3.chk >> $seqres.full +_scratch_cycle_mount + +echo "Compare files" +echo "after reflink" >> $seqres.full +$FILEFRAG_PROG -v $testdir/file2 >> $seqres.full +$FILEFRAG_PROG -v $testdir/file3 >> $seqres.full +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/generic/942.out b/tests/generic/942.out new file mode 100644 index 00000000..529ecff2 --- /dev/null +++ b/tests/generic/942.out @@ -0,0 +1,14 @@ +QA output created by 942 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-942/file1 +5a5221017d3ab8fd7583312a14d2ba80 SCRATCH_MNT/test-942/file2 +6366fd359371414186688a0ef6988893 SCRATCH_MNT/test-942/file3 +6366fd359371414186688a0ef6988893 SCRATCH_MNT/test-942/file3.chk +reflink across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-942/file1 +5a5221017d3ab8fd7583312a14d2ba80 SCRATCH_MNT/test-942/file2 +52bb341f992de6ef4bf5e5d61177eddc SCRATCH_MNT/test-942/file3 +52bb341f992de6ef4bf5e5d61177eddc SCRATCH_MNT/test-942/file3.chk diff --git a/tests/generic/943 b/tests/generic/943 new file mode 100755 index 00000000..91dfa75b --- /dev/null +++ b/tests/generic/943 @@ -0,0 +1,99 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2019, Oracle and/or its affiliates. All Rights Reserved. +# +# FS QA Test No. 943 +# +# Ensuring that reflinking works when the source range covers multiple +# extents, some unwritten, some not: +# +# - Create a file with the following repeating sequence of blocks: +# 1. reflinked +# 2. unwritten +# 3. hole +# 4. regular block +# 5. delalloc +# - reflink across the halfway mark, starting with the unwritten extent. +# - Check that the files are now different where we say they're different. +# +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* $testdir +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_xfs_io_command "falloc" +_require_xfs_io_command "fpunch" +_require_cp_reflink +_require_odirect + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +echo "Create the original files" +blksz=65536 +nr=64 +filesize=$((blksz * nr)) +_pwrite_byte 0x64 0 $((blksz * nr)) $testdir/file2 >> $seqres.full +_pwrite_byte 0x64 0 $((blksz * nr)) $testdir/file2.chk >> $seqres.full +_weave_reflink_rainbow $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full +_scratch_cycle_mount + +echo "Compare files" +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +echo "reflink across the transition" +soff=$((filesize / 4)) +doff=$((filesize / 2)) +rsz=$((filesize / 2)) +_weave_reflink_rainbow_delalloc $blksz $nr $testdir/file3 >> $seqres.full + +# now reflink the rainbow +echo "before reflink" >> $seqres.full +$FILEFRAG_PROG -v $testdir/file2 >> $seqres.full +$FILEFRAG_PROG -v $testdir/file3 >> $seqres.full +$XFS_IO_PROG -f -c "reflink $testdir/file3 $soff $doff $rsz" $testdir/file2 >> $seqres.full +truncate -s $doff $testdir/file2.chk +dd if=$testdir/file3.chk skip=$((soff / blksz)) count=$((rsz / blksz)) bs=$blksz >> $testdir/file2.chk 2> /dev/null +_scratch_cycle_mount + +echo "Compare files" +echo "after reflink" >> $seqres.full +$FILEFRAG_PROG -v $testdir/file2 >> $seqres.full +$FILEFRAG_PROG -v $testdir/file3 >> $seqres.full +md5sum $testdir/file1 | _filter_scratch +md5sum $testdir/file2 | _filter_scratch +md5sum $testdir/file2.chk | _filter_scratch +md5sum $testdir/file3 | _filter_scratch +md5sum $testdir/file3.chk | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/generic/943.out b/tests/generic/943.out new file mode 100644 index 00000000..471c3f34 --- /dev/null +++ b/tests/generic/943.out @@ -0,0 +1,16 @@ +QA output created by 943 +Format and mount +Create the original files +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-943/file1 +5a5221017d3ab8fd7583312a14d2ba80 SCRATCH_MNT/test-943/file2 +5a5221017d3ab8fd7583312a14d2ba80 SCRATCH_MNT/test-943/file2.chk +6366fd359371414186688a0ef6988893 SCRATCH_MNT/test-943/file3 +6366fd359371414186688a0ef6988893 SCRATCH_MNT/test-943/file3.chk +reflink across the transition +Compare files +bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-943/file1 +d93123af536c8c012f866ea383a905ce SCRATCH_MNT/test-943/file2 +d93123af536c8c012f866ea383a905ce SCRATCH_MNT/test-943/file2.chk +7bf7a779a0a54647b41753206c5218b1 SCRATCH_MNT/test-943/file3 +7bf7a779a0a54647b41753206c5218b1 SCRATCH_MNT/test-943/file3.chk diff --git a/tests/generic/944 b/tests/generic/944 new file mode 100755 index 00000000..237cd2da --- /dev/null +++ b/tests/generic/944 @@ -0,0 +1,196 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2019, Oracle and/or its affiliates. All Rights Reserved. +# +# FS QA Test No. 944 +# +# Ensure that we can reflink from a file with a higher inode number to a lower +# inode number and vice versa. Mix it up by doing this test with inodes that +# already share blocks and inodes that don't share blocks. This tests both +# double-inode locking order correctness as well as stressing things like ocfs2 +# which have per-inode sharing groups and therefore have to check that we don't +# try to link data between disjoint sharing groups. +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* $testdir +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_require_scratch_reflink +_require_cp_reflink + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +_scratch_mount >> $seqres.full 2>&1 + +blksz=65536 +nr=2 +filesize=$((blksz * nr)) +testdir=$SCRATCH_MNT/test-$seq +dummy_file=$testdir/dummy +low_file=$testdir/low +high_file=$testdir/high +scenario=1 +mkdir $testdir + +# Return inode number +inum() { + stat -c '%i' $1 +} + +# Create two test files, make $low_file the file with the lower inode +# number, and make $high_file the file with the higher inode number. +create_files() { + _pwrite_byte 0x60 0 $filesize $testdir/file1 >> $seqres.full + _pwrite_byte 0x61 0 $filesize $testdir/file2 >> $seqres.full + if [ "$(inum $testdir/file1)" -lt "$(inum $testdir/file2)" ]; then + mv $testdir/file1 $low_file + mv $testdir/file2 $high_file + else + mv $testdir/file2 $low_file + mv $testdir/file1 $high_file + fi +} + +# Check md5sum of both files, but keep results sorted by inode order +check_files() { + md5sum $low_file | _filter_scratch + md5sum $high_file | _filter_scratch +} + +# Test reflinking data from the first file to the second file +test_files() { + local src="$1" + local dest="$2" + local off=$((filesize / 2)) + local sz=$((filesize / 2)) + + check_files + _reflink_range $src $off $dest $off $sz >> $seqres.full + _scratch_cycle_mount + check_files +} + +# Make a file shared with a dummy file +dummy_share() { + local which="$2" + test -z "$which" && which=1 + local dummy=$dummy_file.$which + + rm -f $dummy + _cp_reflink $1 $dummy +} + +# Make two files share (different ranges) with a dummy file +mutual_dummy_share() { + rm -f $dummy_file + _cp_reflink $1 $dummy_file + _reflink_range $2 0 $dummy_file $blksz $blksz >> $seqres.full +} + +# Announce ourselves, remembering which scenario we've tried +ann() { + echo "$scenario: $@" | tee -a $seqres.full + scenario=$((scenario + 1)) +} + +# Scenario 1: low to high, neither file shares +ann "low to high, neither share" +create_files +test_files $low_file $high_file + +# Scenario 2: high to low, neither file shares +ann "high to low, neither share" +create_files +test_files $high_file $low_file + +# Scenario 3: low to high, only source file shares +ann "low to high, only source shares" +create_files +dummy_share $low_file +test_files $low_file $high_file + +# Scenario 4: high to low, only source file shares +ann "high to low, only source shares" +create_files +dummy_share $high_file +test_files $high_file $low_file + +# Scenario 5: low to high, only dest file shares +ann "low to high, only dest shares" +create_files +dummy_share $high_file +test_files $low_file $high_file + +# Scenario 6: high to low, only dest file shares +ann "high to low, only dest shares" +create_files +dummy_share $low_file +test_files $high_file $low_file + +# Scenario 7: low to high, both files share with each other +ann "low to high, both files share with each other" +create_files +_reflink_range $low_file 0 $high_file 0 $blksz >> $seqres.full +test_files $low_file $high_file + +# Scenario 8: high to low, both files share with each other +ann "high to low, both files share with each other" +create_files +_reflink_range $low_file 0 $high_file 0 $blksz >> $seqres.full +test_files $high_file $low_file + +# Scenario 9: low to high, both files share but not with each other +ann "low to high, both files share but not with each other" +create_files +# ocfs2 can only reflink between files sharing a refcount tree, so for +# this test (and #10) we skip the dummy file because we'd rather not split +# the test code just to mask off the /one/ weird fs like this... +if _supports_arbitrary_fileset_reflink; then + dummy_share $low_file 1 + dummy_share $high_file 2 +fi +test_files $low_file $high_file + +# Scenario 10: high to low, both files share but not with each other +ann "high to low, both files share but not with each other" +create_files +if _supports_arbitrary_fileset_reflink; then + dummy_share $low_file 1 + dummy_share $high_file 2 +fi +test_files $high_file $low_file + +# Scenario 11: low to high, both files share mutually +ann "low to high, both files share mutually" +create_files +mutual_dummy_share $low_file $high_file +test_files $low_file $high_file + +# Scenario 12: high to low, both files share mutually +ann "high to low, both files share mutually" +create_files +mutual_dummy_share $low_file $high_file +test_files $high_file $low_file + +# success, all done +status=0 +exit diff --git a/tests/generic/944.out b/tests/generic/944.out new file mode 100644 index 00000000..aa53fdce --- /dev/null +++ b/tests/generic/944.out @@ -0,0 +1,62 @@ +QA output created by 944 +Format and mount +1: low to high, neither share +07d9f5b0e07f22bff26e39f929cfc460 SCRATCH_MNT/test-944/low +81615449a98aaaad8dc179b3bec87f38 SCRATCH_MNT/test-944/high +07d9f5b0e07f22bff26e39f929cfc460 SCRATCH_MNT/test-944/low +de1d43fbed633326daed6f71912e09e1 SCRATCH_MNT/test-944/high +2: high to low, neither share +07d9f5b0e07f22bff26e39f929cfc460 SCRATCH_MNT/test-944/low +81615449a98aaaad8dc179b3bec87f38 SCRATCH_MNT/test-944/high +0d2ce48b6a4527783bd30ce21f09fec0 SCRATCH_MNT/test-944/low +81615449a98aaaad8dc179b3bec87f38 SCRATCH_MNT/test-944/high +3: low to high, only source shares +07d9f5b0e07f22bff26e39f929cfc460 SCRATCH_MNT/test-944/low +81615449a98aaaad8dc179b3bec87f38 SCRATCH_MNT/test-944/high +07d9f5b0e07f22bff26e39f929cfc460 SCRATCH_MNT/test-944/low +de1d43fbed633326daed6f71912e09e1 SCRATCH_MNT/test-944/high +4: high to low, only source shares +07d9f5b0e07f22bff26e39f929cfc460 SCRATCH_MNT/test-944/low +81615449a98aaaad8dc179b3bec87f38 SCRATCH_MNT/test-944/high +0d2ce48b6a4527783bd30ce21f09fec0 SCRATCH_MNT/test-944/low +81615449a98aaaad8dc179b3bec87f38 SCRATCH_MNT/test-944/high +5: low to high, only dest shares +07d9f5b0e07f22bff26e39f929cfc460 SCRATCH_MNT/test-944/low +81615449a98aaaad8dc179b3bec87f38 SCRATCH_MNT/test-944/high +07d9f5b0e07f22bff26e39f929cfc460 SCRATCH_MNT/test-944/low +de1d43fbed633326daed6f71912e09e1 SCRATCH_MNT/test-944/high +6: high to low, only dest shares +07d9f5b0e07f22bff26e39f929cfc460 SCRATCH_MNT/test-944/low +81615449a98aaaad8dc179b3bec87f38 SCRATCH_MNT/test-944/high +0d2ce48b6a4527783bd30ce21f09fec0 SCRATCH_MNT/test-944/low +81615449a98aaaad8dc179b3bec87f38 SCRATCH_MNT/test-944/high +7: low to high, both files share with each other +07d9f5b0e07f22bff26e39f929cfc460 SCRATCH_MNT/test-944/low +0d2ce48b6a4527783bd30ce21f09fec0 SCRATCH_MNT/test-944/high +07d9f5b0e07f22bff26e39f929cfc460 SCRATCH_MNT/test-944/low +07d9f5b0e07f22bff26e39f929cfc460 SCRATCH_MNT/test-944/high +8: high to low, both files share with each other +07d9f5b0e07f22bff26e39f929cfc460 SCRATCH_MNT/test-944/low +0d2ce48b6a4527783bd30ce21f09fec0 SCRATCH_MNT/test-944/high +0d2ce48b6a4527783bd30ce21f09fec0 SCRATCH_MNT/test-944/low +0d2ce48b6a4527783bd30ce21f09fec0 SCRATCH_MNT/test-944/high +9: low to high, both files share but not with each other +07d9f5b0e07f22bff26e39f929cfc460 SCRATCH_MNT/test-944/low +81615449a98aaaad8dc179b3bec87f38 SCRATCH_MNT/test-944/high +07d9f5b0e07f22bff26e39f929cfc460 SCRATCH_MNT/test-944/low +de1d43fbed633326daed6f71912e09e1 SCRATCH_MNT/test-944/high +10: high to low, both files share but not with each other +07d9f5b0e07f22bff26e39f929cfc460 SCRATCH_MNT/test-944/low +81615449a98aaaad8dc179b3bec87f38 SCRATCH_MNT/test-944/high +0d2ce48b6a4527783bd30ce21f09fec0 SCRATCH_MNT/test-944/low +81615449a98aaaad8dc179b3bec87f38 SCRATCH_MNT/test-944/high +11: low to high, both files share mutually +07d9f5b0e07f22bff26e39f929cfc460 SCRATCH_MNT/test-944/low +81615449a98aaaad8dc179b3bec87f38 SCRATCH_MNT/test-944/high +07d9f5b0e07f22bff26e39f929cfc460 SCRATCH_MNT/test-944/low +de1d43fbed633326daed6f71912e09e1 SCRATCH_MNT/test-944/high +12: high to low, both files share mutually +07d9f5b0e07f22bff26e39f929cfc460 SCRATCH_MNT/test-944/low +81615449a98aaaad8dc179b3bec87f38 SCRATCH_MNT/test-944/high +0d2ce48b6a4527783bd30ce21f09fec0 SCRATCH_MNT/test-944/low +81615449a98aaaad8dc179b3bec87f38 SCRATCH_MNT/test-944/high diff --git a/tests/generic/group b/tests/generic/group index 78b9b45d..2e4341fb 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -538,3 +538,8 @@ 533 auto quick attr 534 auto quick log 535 auto quick log +940 auto quick clone punch +941 auto quick clone punch +942 auto quick clone punch +943 auto quick clone punch +944 auto quick clone punch From patchwork Wed Mar 20 00:45:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10860643 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3C49C1390 for ; Wed, 20 Mar 2019 00:45:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A7C329987 for ; Wed, 20 Mar 2019 00:45:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1EE0A2998C; Wed, 20 Mar 2019 00:45:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C1242998B for ; Wed, 20 Mar 2019 00:45:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727157AbfCTApw (ORCPT ); Tue, 19 Mar 2019 20:45:52 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:40388 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725958AbfCTApw (ORCPT ); Tue, 19 Mar 2019 20:45:52 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2K0ew3Z176930; Wed, 20 Mar 2019 00:45:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=8R3+OH4iPdwZEPCXjD7hAcl+dOZsIFak3rrj+7HYTAc=; b=M4AJ970VTK4gV2ubx9eIE9EZTLC+SECfdzBG26L0k62qHWAVITG/5fTpCs7gWyR87TFu D/ZtTfoPdL3gPjbi90QDIgJF+iYbinmxWL4Z1kK+vANNJvuEhAZLv/AcXNYORdM8BJ3l ijJtnyBbI7kyas15ru2ISIhT7OtqryJCCXwzY7MkZEkwtKW5OJuF+J4N9bvjC5Mqj/vQ 056uLmp+eLIzIBGylPFWV2OCl5ZuIFOBgHe6PzIVMJpaUeBymltlwFZf7AKCRu+McNqq xR+6zidYHwgxBKIEb7uXNyEW2jigUGQSl6wawsUHcvJLO1R836tHbkieIm+KIr+gEmMk 0w== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2r8ssrfsft-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:45:50 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x2K0jn41017076 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:45:49 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x2K0jnKm022569; Wed, 20 Mar 2019 00:45:49 GMT Received: from localhost (/10.159.245.168) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 Mar 2019 17:45:49 -0700 Subject: [PATCH 10/12] xfs: test xfs_copy and xfs_mdrestore on the populate images From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 19 Mar 2019 17:45:49 -0700 Message-ID: <155304274924.31707.623436868976936668.stgit@magnolia> In-Reply-To: <155304267647.31707.14180452399822113095.stgit@magnolia> References: <155304267647.31707.14180452399822113095.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9200 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903200003 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong Make sure that copy, metadump, and mdrestore work on a filesystem with all known metadata types. Signed-off-by: Darrick J. Wong --- tests/xfs/740 | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/740.out | 12 +++++++ tests/xfs/group | 1 + 3 files changed, 110 insertions(+) create mode 100755 tests/xfs/740 create mode 100644 tests/xfs/740.out diff --git a/tests/xfs/740 b/tests/xfs/740 new file mode 100755 index 00000000..0ff548cb --- /dev/null +++ b/tests/xfs/740 @@ -0,0 +1,97 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2019 Oracle, Inc. All Rights Reserved. +# +# FS QA Test No. 740 +# +# Populate a XFS filesystem and ensure that metadump, mdrestore, and copy +# all work properly. +# +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 7 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* $testdir +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/populate + +testdir=$TEST_DIR/test-$seq + +# real QA test starts here +_supported_os Linux +_supported_fs xfs + +_require_scratch_nocheck +_require_populate_commands + +echo "Format and populate" +_scratch_populate_cached nofill > $seqres.full 2>&1 + +mkdir -p $testdir +metadump_file=$testdir/scratch.md +metadump_file_a=${metadump_file}.a +metadump_file_g=${metadump_file}.g +metadump_file_ag=${metadump_file}.ag +copy_file=$testdir/copy.img + +echo metadump +_scratch_metadump $metadump_file + +echo metadump a +_scratch_metadump $metadump_file_a + +echo metadump g +_scratch_metadump $metadump_file_g + +echo metadump ag +_scratch_metadump $metadump_file_ag + +echo copy +$XFS_COPY_PROG $SCRATCH_DEV $copy_file >> $seqres.full +_check_scratch_fs $copy_file + +echo recopy +$XFS_COPY_PROG $copy_file $SCRATCH_DEV >> $seqres.full +_scratch_mount +_check_scratch_fs +_scratch_unmount + +echo mdrestore +xfs_mdrestore $metadump_file $SCRATCH_DEV +_scratch_mount +_check_scratch_fs +_scratch_unmount + +echo mdrestore a +xfs_mdrestore $metadump_file_a $SCRATCH_DEV +_scratch_mount +_check_scratch_fs +_scratch_unmount + +echo mdrestore g +xfs_mdrestore $metadump_file_g $SCRATCH_DEV +_scratch_mount +_check_scratch_fs +_scratch_unmount + +echo mdrestore ag +xfs_mdrestore $metadump_file_ag $SCRATCH_DEV +_scratch_mount +_check_scratch_fs +_scratch_unmount + +# success, all done +status=0 +exit diff --git a/tests/xfs/740.out b/tests/xfs/740.out new file mode 100644 index 00000000..0c979dc4 --- /dev/null +++ b/tests/xfs/740.out @@ -0,0 +1,12 @@ +QA output created by 740 +Format and populate +metadump +metadump a +metadump g +metadump ag +copy +recopy +mdrestore +mdrestore a +mdrestore g +mdrestore ag diff --git a/tests/xfs/group b/tests/xfs/group index 9d9458b8..b8bd1012 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -500,3 +500,4 @@ 500 auto quick mkfs prealloc mkfs 501 auto quick unlink 502 auto quick unlink +740 auto copy metadump From patchwork Wed Mar 20 00:45:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10860645 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BB5881669 for ; Wed, 20 Mar 2019 00:45:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9856629997 for ; Wed, 20 Mar 2019 00:45:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8CC372998B; Wed, 20 Mar 2019 00:45:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 458CF2998C for ; Wed, 20 Mar 2019 00:45:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727274AbfCTAp6 (ORCPT ); Tue, 19 Mar 2019 20:45:58 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:52562 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725958AbfCTAp6 (ORCPT ); Tue, 19 Mar 2019 20:45:58 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2K0dnD6169036; Wed, 20 Mar 2019 00:45:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=rsaDHcnJKIscsGVxTpFZ+GKz6trYQ9D60X4wPZjsctU=; b=TBCzmOGBanidstHcQL5s2En3mZ+phy1M6LVpbVcUFb/0XmEpgcXeVRYyQYQGg6n9i9xR 6MBHeC4axR56Dth0AUfruIwKA/SYJk6z6hOgK62RM5LagQWRq6iBrkNsC4TQAzjBFxpV sCKtTdlPtf1RJNfxrbNuey7PNxHsmqUbHg5pRyNn2b7hJYKZ7k3KOQ2q9FDa9+PNg1qK y0P0UpYwhl0gf1J1alKjZORGiuzIwmBTDtFUvSSH8QM7QT2YDkm+EpvUySb+7HoCqctQ Ff3PufzIPQC2dO7ZLV04NIQV/jWLiZkjKzYJHzc5548fuJAsKZByfSyXwX8q9Qq2G5b3 GA== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2r8rjuqwy5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:45:56 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x2K0jtBE017202 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:45:55 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x2K0jt0q004321; Wed, 20 Mar 2019 00:45:55 GMT Received: from localhost (/10.159.245.168) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 Mar 2019 17:45:55 -0700 Subject: [PATCH 11/12] check: wipe scratch devices between tests From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 19 Mar 2019 17:45:55 -0700 Message-ID: <155304275552.31707.6473598082840688691.stgit@magnolia> In-Reply-To: <155304267647.31707.14180452399822113095.stgit@magnolia> References: <155304267647.31707.14180452399822113095.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9200 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903200003 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong Wipe the scratch devices in between each test to ensure that tests are formatting them and not making assumptions about previous contents. Signed-off-by: Darrick J. Wong --- check | 1 + common/rc | 6 ++++++ common/xfs | 1 + 3 files changed, 8 insertions(+) diff --git a/check b/check index a2c5ba21..bcf08dfe 100755 --- a/check +++ b/check @@ -737,6 +737,7 @@ for section in $HOST_OPTIONS_SECTIONS; do # _check_dmesg depends on this log in dmesg touch ${RESULT_DIR}/check_dmesg fi + _try_wipe_scratch_devs > /dev/null 2>&1 if [ "$DUMP_OUTPUT" = true ]; then ./$seq 2>&1 | tee $tmp.out # Because $? would get tee's return code diff --git a/common/rc b/common/rc index 1c42515f..40eef80f 100644 --- a/common/rc +++ b/common/rc @@ -3942,6 +3942,12 @@ _require_fibmap() rm -f $file } +_try_wipe_scratch_devs() +{ + _scratch_unmount + test -x "$WIPEFS_PROG" && $WIPEFS_PROG -a $SCRATCH_DEV_POOL $SCRATCH_DEV $SCRATCH_LOGDEV $SCRATCH_RTDEV +} + init_rc ################################################################################ diff --git a/common/xfs b/common/xfs index 24065813..af2b62ba 100644 --- a/common/xfs +++ b/common/xfs @@ -295,6 +295,7 @@ _require_xfs_db_command() fi command=$1 + _scratch_mkfs_xfs >/dev/null 2>&1 _scratch_xfs_db -x -c "help" | grep $command > /dev/null || \ _notrun "xfs_db $command support is missing" } From patchwork Wed Mar 20 00:46:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10860651 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A76DF1669 for ; Wed, 20 Mar 2019 00:46:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 95EAD2998B for ; Wed, 20 Mar 2019 00:46:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A7A629999; Wed, 20 Mar 2019 00:46:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 274352998B for ; Wed, 20 Mar 2019 00:46:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726939AbfCTAqE (ORCPT ); Tue, 19 Mar 2019 20:46:04 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:40476 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725958AbfCTAqE (ORCPT ); Tue, 19 Mar 2019 20:46:04 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2K0ew3b176930; Wed, 20 Mar 2019 00:46:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=0cY6OyKjS1DnbblrXJGk4cB3j803XPQ6dXXEEg+yxWs=; b=QT3fSzueDdQVrHnf3vGofWwJNN4BAKkO0CfvFncNKaTh81Zw22EVQUpNOK4ZC7JM0Mt8 CKi8uGhb7VvVg7pMMmG5IxD71NOl5ykPduwjyX5RMk0+p7E5ML3KQxcXx5xkFkAgvg9J 5pFQy2ylACrDyUnir1QhPrSSd+X9uwJUVaBdTGMxBxRLo7SjRAdPOEvYuB0z13CDp4Lp Xe1oE8lEMJZlGeqzacVDG9AAmMKPVm6rtN3hAmS18dwGswXAjn5ty51S1DDBPb7zDcP5 6uQgGmi3ZHUU96vzaikB9QKXfFuxQtTeiGnn/UFI8fH61Wnaw7V1vWObbuFn5qyuXu2x Qw== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2r8ssrfsga-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:46:02 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x2K0k1vk017789 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:46:01 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x2K0k1Is004408; Wed, 20 Mar 2019 00:46:01 GMT Received: from localhost (/10.159.245.168) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 Mar 2019 17:46:01 -0700 Subject: [PATCH 12/12] misc: fix broken _require_scratch usage From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 19 Mar 2019 17:46:01 -0700 Message-ID: <155304276173.31707.10078225002860661364.stgit@magnolia> In-Reply-To: <155304267647.31707.14180452399822113095.stgit@magnolia> References: <155304267647.31707.14180452399822113095.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9200 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903200003 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong _require_scratch doesn't actually format the scratch device with anything, which means that tests are required to format them before using them. Fix tests that don't do this correctly. Signed-off-by: Darrick J. Wong --- tests/generic/026 | 1 - tests/generic/100 | 3 --- tests/generic/506 | 2 +- tests/xfs/065 | 2 +- tests/xfs/108 | 1 + tests/xfs/109 | 2 +- tests/xfs/194 | 4 +++- tests/xfs/261 | 2 ++ tests/xfs/284 | 1 + 9 files changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/generic/026 b/tests/generic/026 index 6cbd2829..31cd0827 100755 --- a/tests/generic/026 +++ b/tests/generic/026 @@ -32,7 +32,6 @@ _cleanup() _supported_fs generic _supported_os Linux _require_test -_require_scratch _acl_setup_ids _require_acls _require_acl_get_max diff --git a/tests/generic/100 b/tests/generic/100 index c2593333..927c4949 100755 --- a/tests/generic/100 +++ b/tests/generic/100 @@ -52,9 +52,6 @@ _populate_fs -n $NDIRS -f $NFILES -d $DEPTH -r $POPULATED_DIR -s $SIZE >>$seqres # Then tar up the directory structure tar -cvf $TEMP_DIR/$TAR_FILE $POPULATED_DIR >>$seqres.full 2>&1 -# create f/s -_require_scratch - # untar on f/s cd $TEST_DIR tar -xvf $TEMP_DIR/$TAR_FILE >>$seqres.full 2>&1 diff --git a/tests/generic/506 b/tests/generic/506 index 5d419cad..7002c00c 100755 --- a/tests/generic/506 +++ b/tests/generic/506 @@ -46,12 +46,12 @@ _supported_os Linux _require_command "$LSATTR_PROG" lsattr _require_command "$CHATTR_PROG" chattr -_require_prjquota $SCRATCH_DEV _require_scratch _require_scratch_shutdown _scratch_mkfs >/dev/null 2>&1 _require_metadata_journaling $SCRATCH_DEV +_require_prjquota $SCRATCH_DEV testfile=$SCRATCH_MNT/testfile diff --git a/tests/xfs/065 b/tests/xfs/065 index c3472486..c0d1ee93 100755 --- a/tests/xfs/065 +++ b/tests/xfs/065 @@ -55,7 +55,7 @@ _supported_os Linux # too much hassle to get output matching with quotas turned on # so don't run it # -_scratch_unmount 2>/dev/null +_scratch_mkfs_xfs >> $seqres.full _scratch_mount $here/src/feature -U $SCRATCH_DEV && \ _notrun "UQuota enabled, test needs controlled xfsdump output" diff --git a/tests/xfs/108 b/tests/xfs/108 index c47f4f37..e70a1f9a 100755 --- a/tests/xfs/108 +++ b/tests/xfs/108 @@ -61,6 +61,7 @@ test_accounting() } export MOUNT_OPTIONS="-opquota" +_scratch_mkfs_xfs >> $seqres.full _qmount _require_prjquota $SCRATCH_DEV diff --git a/tests/xfs/109 b/tests/xfs/109 index a063dc3f..df4ec157 100755 --- a/tests/xfs/109 +++ b/tests/xfs/109 @@ -75,7 +75,7 @@ allocate() } # real QA test starts here -_scratch_unmount 2>/dev/null +_scratch_mkfs_xfs >> $seqres.full _scratch_mount rm -f $seqres.full diff --git a/tests/xfs/194 b/tests/xfs/194 index 6c1eddba..3e186528 100755 --- a/tests/xfs/194 +++ b/tests/xfs/194 @@ -32,6 +32,9 @@ _supported_os Linux # real QA test starts here rm -f $seqres.full +_require_scratch +_scratch_mkfs_xfs >/dev/null 2>&1 + # For this test we use block size = 1/8 page size pgsize=`$here/src/feature -s` blksize=`expr $pgsize / 8` @@ -70,7 +73,6 @@ _filter_od() sed -e "s/^[0-9A-Fa-f ]\{7,8\}//" } -_require_scratch unset MKFS_OPTIONS unset XFS_MKFS_OPTIONS diff --git a/tests/xfs/261 b/tests/xfs/261 index 0fabcd64..92152ace 100755 --- a/tests/xfs/261 +++ b/tests/xfs/261 @@ -47,6 +47,8 @@ _supported_os Linux _require_quota _require_scratch +_scratch_mkfs >> $seqres.full 2>&1 + # Just use the current mount table as an example mtab file. Odds # are good there's nothing wrong with it. _setup_my_mtab() { diff --git a/tests/xfs/284 b/tests/xfs/284 index 07f71031..7af77634 100755 --- a/tests/xfs/284 +++ b/tests/xfs/284 @@ -50,6 +50,7 @@ COPY_FILE="${TEST_DIR}/${seq}_copyfile" # Test dump a mounted device # xfs_metadump should refuse to dump a mounted device +_scratch_mkfs >> $seqres.full 2>&1 _scratch_mount _scratch_metadump $METADUMP_FILE 2>&1 | filter_mounted _scratch_unmount