From patchwork Thu Nov 1 23:19:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10664657 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 674CE14E2 for ; Thu, 1 Nov 2018 23:19:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 569042C4F4 for ; Thu, 1 Nov 2018 23:19:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4AF352C518; Thu, 1 Nov 2018 23:19:14 +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=ham 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 E5BCD2C4F4 for ; Thu, 1 Nov 2018 23:19:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728088AbeKBIYP (ORCPT ); Fri, 2 Nov 2018 04:24:15 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:53878 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727749AbeKBIYP (ORCPT ); Fri, 2 Nov 2018 04:24:15 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wA1NJBcN087765; Thu, 1 Nov 2018 23:19:11 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=S+PWOMCne8OUyzTMNu9rlztV1si3joWs0P2mDfuw2O8=; b=27bBufaFDO023MZx6PS1akGL3zCfZ2ZWdOBsaaT//SiANo2vAvU+L4sM9Fzgksu4vNOf wssoTS1SYGwiUTszHX+IOZyrNOy+Kag5Fag+jc86EOL9r7DOLPMhIovrL582OHPGuEUo ZRVyO+XZDFpQCL/wyLJ7T1tYDVfOmrK+fJCXNxia3OtX9Qldh5WASnniLGCVOx8PVzA/ jCiZWfH803Nap1glROJNRDuYFo0i0YQcgNM9RFiaC8TQiYQGJXEOSX2tJNz429KBTt6e jc0DrXA3V8xubXP547Spl2O1aOQ55vvSeR1JtA75QKZe/ld9wZzqgCOGJ3LDU/YeZ9JO xA== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2ncgnrbq4b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Nov 2018 23:19:11 +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 wA1NJAS3001733 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 1 Nov 2018 23:19:10 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wA1NJAp1030777; Thu, 1 Nov 2018 23:19:10 GMT Received: from localhost (/10.145.178.77) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 01 Nov 2018 16:19:10 -0700 Subject: [PATCH 1/8] quota: clean out speculative preallocations when checking quota usage From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Thu, 01 Nov 2018 16:19:09 -0700 Message-ID: <154111434915.6577.14047300095921080052.stgit@magnolia> In-Reply-To: <154111434286.6577.15010861884505931015.stgit@magnolia> References: <154111434286.6577.15010861884505931015.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9064 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1811010194 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong On XFS, the only reliable way to clean out speculative post-eof preallocations, delayed allocations, and speculative cow preallocations is to cycle the filesystem mount. Since we're comparing the post-test quota counts against a freshly quotacheck to look for leaks, it's fine to cycle the mount. This eliminates sporadic quota count failures when running xfstests with quotas enabled. Signed-off-by: Darrick J. Wong --- common/quota | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/quota b/common/quota index 993ff5de..9309e786 100644 --- a/common/quota +++ b/common/quota @@ -260,10 +260,10 @@ _check_quota_usage() quotaon -f -u -g $SCRATCH_MNT 2>/dev/null ;; xfs) - # Clear out speculative preallocations to eliminate them - # as a source of intermittent orig/checked differences. - test -x "$XFS_SPACEMAN_PROG" && \ - "$XFS_SPACEMAN_PROG" -c 'prealloc -s' $SCRATCH_MNT + # Only way to make this reliable with cow/delalloc/speculative + # preallocations is to unmount and remount the whole mess... + _scratch_unmount + _scratch_mount "-o usrquota,grpquota" ;; *) ;; From patchwork Thu Nov 1 23:19:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10664661 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 C0DF817DB for ; Thu, 1 Nov 2018 23:19:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0E7C2C4F4 for ; Thu, 1 Nov 2018 23:19:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A50772C518; Thu, 1 Nov 2018 23:19: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=ham 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 516412C4F4 for ; Thu, 1 Nov 2018 23:19:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728137AbeKBIYV (ORCPT ); Fri, 2 Nov 2018 04:24:21 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:52744 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727749AbeKBIYV (ORCPT ); Fri, 2 Nov 2018 04:24:21 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wA1NJ8cu134487; Thu, 1 Nov 2018 23:19:18 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=KZjlqCd+dQeXs5LyB5/cnkUSHMCrTCDCN7I5wIXb3Fw=; b=G+Cx0jEFoY5tA2cE32j2rhYSbg9G8RjeXSgW8jFV8ygVAmWbplSGVpzkTTMBJ19yTI6J poizwdRnhMZQSywV73q+VjV5wUC8delv6gRe9Pv6/W09hgbMgAOUZGtjXYNYTdfY8AWS c6jQlt+cBO7wDv9r5NJXYLnJS+fihETCmTyizGAKUcZA010KvFWKXJFdk5NQ70Fbah1y sOo1NBJ6d7YRksI1vxjxdrZYEN8pyjHbCOSSQ7F4rtt7hCxwhZY6WHNnfYMxwN8voNJy UyKSLsy2Oz5PFVGt+pjl7stkKslDXrc5e2IZQ1boDpZUckHzSfSHMBWgBe1LbAOGo9dE TQ== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2ncfyqbprc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Nov 2018 23:19:17 +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 wA1NJGMq019370 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 1 Nov 2018 23:19:17 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wA1NJGIX030796; Thu, 1 Nov 2018 23:19:16 GMT Received: from localhost (/10.145.178.77) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 01 Nov 2018 16:19:16 -0700 Subject: [PATCH 2/8] xfs: force unlink metadata updates to disk From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Thu, 01 Nov 2018 16:19:15 -0700 Message-ID: <154111435522.6577.18438780918971479613.stgit@magnolia> In-Reply-To: <154111434286.6577.15010861884505931015.stgit@magnolia> References: <154111434286.6577.15010861884505931015.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9064 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=919 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1811010194 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong In xfs/318 and xfs/325 we inject errors on extent freeing then delete some files to see if we can make the filesystem go offline. However, with the advent of deferred inode inactivation, sync won't guarantee that unlinked inodes removal is actually pushed to disk since the "inode needs to be deallocated" state is persisted to disk. Freeze achieves this, however, so inject a freeze/thaw cycle to make sure we hit the injected error. Signed-off-by: Darrick J. Wong --- tests/xfs/318 | 1 + tests/xfs/325 | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/xfs/318 b/tests/xfs/318 index 2f2a34b0..83b858ea 100755 --- a/tests/xfs/318 +++ b/tests/xfs/318 @@ -59,6 +59,7 @@ _scratch_inject_error "free_extent" echo "Remove files" rm -rf $SCRATCH_MNT/file1 sync +$XFS_IO_PROG -x -c 'freeze' -c 'thaw' $SCRATCH_MNT >> $seqres.full 2>&1 echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch diff --git a/tests/xfs/325 b/tests/xfs/325 index 67959015..eafb4ae0 100755 --- a/tests/xfs/325 +++ b/tests/xfs/325 @@ -62,6 +62,7 @@ _scratch_inject_error "free_extent" rm $SCRATCH_MNT/file1 sync +$XFS_IO_PROG -x -c 'freeze' -c 'thaw' $SCRATCH_MNT >> $seqres.full 2>&1 echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch From patchwork Thu Nov 1 23:19:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10664665 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 F349414E2 for ; Thu, 1 Nov 2018 23:19:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4AFB2C4F4 for ; Thu, 1 Nov 2018 23:19:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D5DEC2C518; Thu, 1 Nov 2018 23:19:31 +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=ham 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 7AD092C4F4 for ; Thu, 1 Nov 2018 23:19:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728144AbeKBIYc (ORCPT ); Fri, 2 Nov 2018 04:24:32 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:54134 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727749AbeKBIYc (ORCPT ); Fri, 2 Nov 2018 04:24:32 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wA1NJ2At087596; Thu, 1 Nov 2018 23:19:28 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=1bPsTbGWK80fKuimb5GbCByQyJn1EcMlQgKxwEzg+94=; b=KnxLIASGxrkzT+Z5UQ0LfGZnYvpvFqEdnrllqtw9mjw2IEqkuVlh+Nr8fmuZlhCT1tT1 1FHCx9CsBwuf+Bzm1swv6hR+mGOIZ9FZnA5uD7ODesJc6lUyTwF6Pkxc+T085wmWoY0p +xudUOkQCT0zAKcCO3S1f8AaNIp7NuEW5GVKM/25LcPsoKF0wtB3bB5q5TelfJXp3RQF OD5q2CfmMuFs8ZrAgpop3ZU8LWufj/W/GwE/FdAkyFlKpO2URdSQDob67THhRyNCXCRe U/B3J+3MS+eRw/Y0uUBU71u4gk6UYsVWpQYbKQh5AMk7D82QCA1NY1F9WBZ7gvqA29Zn Ew== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2120.oracle.com with ESMTP id 2ncgnrbq4u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Nov 2018 23:19:28 +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 wA1NJM1o010658 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 1 Nov 2018 23:19:23 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wA1NJMPT031716; Thu, 1 Nov 2018 23:19:22 GMT Received: from localhost (/10.145.178.77) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 01 Nov 2018 16:19:22 -0700 Subject: [PATCH 3/8] generic/050: fix ro blockdev mount of xfs with quota From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Thu, 01 Nov 2018 16:19:21 -0700 Message-ID: <154111436126.6577.15057711037961689350.stgit@magnolia> In-Reply-To: <154111434286.6577.15010861884505931015.stgit@magnolia> References: <154111434286.6577.15010861884505931015.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9064 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1811010194 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong In XFS, mounting with quota always require a writable device. If the block device is read only, the mount fails, which fails this test. Since this is expected, work around this. Signed-off-by: Darrick J. Wong --- tests/generic/050 | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/tests/generic/050 b/tests/generic/050 index 90e924db..33da228d 100755 --- a/tests/generic/050 +++ b/tests/generic/050 @@ -36,6 +36,21 @@ _require_norecovery _scratch_mkfs >/dev/null 2>&1 +filter_ro_mount() { + local arg="" + + # Mounting with quota on XFS requires a writable fs, which means + # we fail the ro blockdev test with with EPERM. + if [ "$FSTYP" = "xfs" ] && echo "$MOUNT_OPTIONS" | grep -q quota ; then + arg="s|mount: $SCRATCH_MNT: permission denied|mount: device write-protected, mounting read-only|g" + fi + sed -e "$arg" | _filter_ro_mount +} + +filter_umount() { + sed -e "\|umount: $SCRATCH_DEV: not mounted.|d" | _filter_scratch +} + # # Mark the device read-only # @@ -46,7 +61,7 @@ blockdev --setro $SCRATCH_DEV # Mount it, and make sure we can't write to it, and we can unmount it again # echo "mounting read-only block device:" -_try_scratch_mount 2>&1 | _filter_ro_mount +_try_scratch_mount 2>&1 | filter_ro_mount echo "touching file on read-only filesystem (should fail)" touch $SCRATCH_MNT/foo 2>&1 | _filter_scratch @@ -56,7 +71,7 @@ touch $SCRATCH_MNT/foo 2>&1 | _filter_scratch # http://oss.sgi.com/bugzilla/show_bug.cgi?id=807 # echo "unmounting read-only filesystem" -_scratch_unmount 2>&1 | _filter_scratch +_scratch_unmount 2>&1 | filter_umount echo "setting device read-write" blockdev --setrw $SCRATCH_DEV @@ -92,10 +107,10 @@ _scratch_unmount 2>&1 | _filter_scratch | _filter_ending_dot # data recovery hack. # echo "mounting filesystem with -o norecovery on a read-only device:" -_try_scratch_mount -o norecovery 2>&1 | _filter_ro_mount +_try_scratch_mount -o norecovery 2>&1 | filter_ro_mount echo "unmounting read-only filesystem" -_scratch_unmount 2>&1 | _filter_scratch +_scratch_unmount 2>&1 | filter_umount echo "setting device read-write" blockdev --setrw $SCRATCH_DEV From patchwork Thu Nov 1 23:19:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10664669 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 0263114E2 for ; Thu, 1 Nov 2018 23:19:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E587E2C4F4 for ; Thu, 1 Nov 2018 23:19:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9ADC2C518; Thu, 1 Nov 2018 23:19:32 +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=ham 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 7BF632C4F4 for ; Thu, 1 Nov 2018 23:19:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728150AbeKBIYd (ORCPT ); Fri, 2 Nov 2018 04:24:33 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:52988 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727749AbeKBIYd (ORCPT ); Fri, 2 Nov 2018 04:24:33 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wA1NJ1ED134419; Thu, 1 Nov 2018 23:19: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=sdg03FQZO8Oc9IMiFk+F0Ev8xDnv/Za5GqiYyyUpIx4=; b=nvJ4IcwwKDHwNTZ3bNE7dToYSgKHCqEa83g9ps2xyIt5RJySj8gC7a4Txaydf4PjgT5C lkiPK4QbHE1/iFtQWLHlJSvhGXt9cIrxZ4Ub6LAC5/wIAT63tJVIJW+KX9KKWWQSP0F9 uD7H7kI39JczXoczYSTbwk+9awQcPsHSeT41p5JUySncLlArn5C/x+CRYC13bTlJS1kL Uf/Id+s6hD8DbtxluhVKBy1y0imrOA0k9BW40DAs17TyYto2ebf4qtOWDzaMiWbujomt emzRcaFv0vB+yksppMJJapg8wUOt8SOdvNjmh5sAFexnJZIAXAEvwLZR+jfyOWNuOKP+ PQ== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2ncfyqbps4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Nov 2018 23:19:30 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wA1NJTN3010821 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 1 Nov 2018 23:19:29 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wA1NJTu3005641; Thu, 1 Nov 2018 23:19:29 GMT Received: from localhost (/10.145.178.77) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 01 Nov 2018 16:19:28 -0700 Subject: [PATCH 4/8] dump: don't fail if multi-file dumps don't all contain quota info From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Thu, 01 Nov 2018 16:19:27 -0700 Message-ID: <154111436733.6577.618179444183829859.stgit@magnolia> In-Reply-To: <154111434286.6577.15010861884505931015.stgit@magnolia> References: <154111434286.6577.15010861884505931015.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9064 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=926 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1811010194 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong When xfsdump is making multi-file dumps, the quota information are written into the last dump file. However, the multi-file restore script (as written) expects to see quota information restored by every dump file and fails. This is silly, so fix it. Signed-off-by: Darrick J. Wong --- common/dump | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/common/dump b/common/dump index b6b7fb46..c45b8a5a 100644 --- a/common/dump +++ b/common/dump @@ -1432,16 +1432,19 @@ _check_quota() print "Found extra:", $0 } next + } + $0 ~ "Restore Status: INCOMPLETE" { + incomplete = 1 } { print } END { - if (uquota && !found_uquota) { + if (uquota && !found_uquota && !incomplete) { print "Missing user quota msg:", usermsg } - if (gquota && !found_gquota) { + if (gquota && !found_gquota && !incomplete) { print "Missing group quota msg:", groupmsg } - if (pquota && !found_pquota) { + if (pquota && !found_pquota && !incomplete) { print "Missing project quota msg:", projectmsg } } From patchwork Thu Nov 1 23:19:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10664673 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 E9C8017DB for ; Thu, 1 Nov 2018 23:19:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DAFB42C4F4 for ; Thu, 1 Nov 2018 23:19:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CFD372C518; Thu, 1 Nov 2018 23:19:38 +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=ham 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 7D5232C4F4 for ; Thu, 1 Nov 2018 23:19:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728091AbeKBIYk (ORCPT ); Fri, 2 Nov 2018 04:24:40 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:54246 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727749AbeKBIYj (ORCPT ); Fri, 2 Nov 2018 04:24:39 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wA1NJ2Au087596; Thu, 1 Nov 2018 23:19:36 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=eTZ/ZbKXsagZCCqwWFxdOB05aYvbsxgdVixxSY5hEtI=; b=aRqrxsa6gnGq82vGDUbTeu5ndC0DyUpMDICQgaPI3Z3xPTsn78HgMcBw2MVLXj1Pv1QL obk1KiuNcGOC8D/PDt0F5YsPT2Z1gDwRXGX68FEWlroekXlNWWjVZUkCg8JfV1Q0Pywf /8ON5BmC4IoziDPvLAgSNVfxmTQz7HudPMfQUIfnQ7xjLrBHqPY3SiVH035ZcU9MAdCk vQBRE77QdGhH4g4lSoB5gaIWoiFswbkTAp/AwQFiZAD8pR2vGhSRJ2U5lrMG+sV2mXUw sUVgVXoGwyQ+wRh9r0fjLdZD4mFheICTe1QTCInotDjOxRB5IQZPHZfB7e8SF57yZVSI Yg== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2ncgnrbq57-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Nov 2018 23:19:36 +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 wA1NJZ9I020040 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 1 Nov 2018 23:19:35 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wA1NJZrd030860; Thu, 1 Nov 2018 23:19:35 GMT Received: from localhost (/10.145.178.77) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 01 Nov 2018 16:19:35 -0700 Subject: [PATCH 5/8] xfs/266: fix restore summary counter when quotas are enabled From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Thu, 01 Nov 2018 16:19:33 -0700 Message-ID: <154111437365.6577.10855653156134262665.stgit@magnolia> In-Reply-To: <154111434286.6577.15010861884505931015.stgit@magnolia> References: <154111434286.6577.15010861884505931015.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9064 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1811010194 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong When quotas are enabled, an incremental backup has to record the quota file updates too. Inside a dump the quota files are stored as special files under the root dump directory. xfsrestore reports the dump dir in its restore summary counts even if the dump dir was only there for the sake of the quota updates, which makes the test fail. Fix this by massaging the output when quotas are turned on. Signed-off-by: Darrick J. Wong --- tests/xfs/266 | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/xfs/266 b/tests/xfs/266 index c4c3e8d9..9084f5b9 100755 --- a/tests/xfs/266 +++ b/tests/xfs/266 @@ -26,6 +26,21 @@ _add_and_append_dumpdir_fill() _append_dumpdir_fill } +# Quota files are stored as special files in the dumpdir of the incremental +# backup. This throws off the directory/file count reported because xfsrestore +# includes the dumpdir in the restore summary counts. +filter_cumulative_quota_updates() { + $here/src/feature -U $SCRATCH_DEV && quota=1 + $here/src/feature -G $SCRATCH_DEV && quota=1 + $here/src/feature -P $SCRATCH_DEV && quota=1 + + $AWK_PROG -v quota=$quota ' + /entries processed/ { + if (quota) {$2--; $5--;} + } + {print}' +} + # get standard environment, filters and checks . ./common/rc . ./common/dump @@ -47,7 +62,7 @@ _add_and_append_dumpdir_fill _do_dump_file -f $tmp.df.1 -l 1 -D _prepare_restore_dir _do_restore_file_cum -f $tmp.df.0 -_do_restore_file_cum -f $tmp.df.1 +_do_restore_file_cum -f $tmp.df.1 | filter_cumulative_quota_updates _ls_compare_sub _diff_compare From patchwork Thu Nov 1 23:19:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10664679 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 F0AD117DF for ; Thu, 1 Nov 2018 23:19:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E445A2C4F4 for ; Thu, 1 Nov 2018 23:19:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8C742C515; Thu, 1 Nov 2018 23:19:46 +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 A7A6C2C4F4 for ; Thu, 1 Nov 2018 23:19:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728056AbeKBIYr (ORCPT ); Fri, 2 Nov 2018 04:24:47 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:53210 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727749AbeKBIYr (ORCPT ); Fri, 2 Nov 2018 04:24:47 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wA1NJhru134742; Thu, 1 Nov 2018 23:19: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=5TYQWYgfDP8wo294hLa9dmEMQ2tSro/Ei09dSebnqEU=; b=nFeWmQaTqBCYE4XnMqNYCTlTlUA3JH/1QiF52gk6NbSEqQMaVF2jgiLkFbV1CLCPYKR6 TGXyE7NMvWuIeMtMXE7B0+eWKACVlHhy7MU6WxOnAjmgH+cnxRoc4HexNBWcTyP6VuF/ TTGjt8++7NP6xyXh/KMi2Oyjq4H9r8aK6fEqWhs0SslsQ2GqxVQtF2oaDMMfyxsnkDS3 fFRy0SI76hDJ2xAadnOH41E6qAqXNzyfMb6R/z4rlBI/NgXafji6MD1anpdSYsVbWcOo 0Ln0Di5e3QsfyEfuWMKuE4Aor/gRYHDbQfMbX1GerZd5KEzQY3ocHmjecDwGNItWv/71 mw== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2ncfyqbpsh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Nov 2018 23:19:42 +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 wA1NJgLq020213 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 1 Nov 2018 23:19:42 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wA1NJf5q030873; Thu, 1 Nov 2018 23:19:41 GMT Received: from localhost (/10.145.178.77) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 01 Nov 2018 16:19:41 -0700 Subject: [PATCH 6/8] xfs/205: update for v5 filesystems From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Thu, 01 Nov 2018 16:19:40 -0700 Message-ID: <154111437994.6577.18298654458777481642.stgit@magnolia> In-Reply-To: <154111434286.6577.15010861884505931015.stgit@magnolia> References: <154111434286.6577.15010861884505931015.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9064 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1811010194 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong Update this test to work with v5 filesystems, which have a minimum block size of 1k. Adapt the script to sense the amount of free space reported so that we can get close to ENOSPC instead of hardcoding. Signed-off-by: Darrick J. Wong --- tests/xfs/205 | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/tests/xfs/205 b/tests/xfs/205 index ed07d165..9cc9b599 100755 --- a/tests/xfs/205 +++ b/tests/xfs/205 @@ -27,14 +27,15 @@ _require_scratch_nocheck rm -f $seqres.full -_scratch_mkfs_xfs -d size=16m -b size=512 -l size=4944b >> $seqres.full 2>&1 +fsblksz=1024 +_scratch_mkfs_xfs -d size=$((32768*fsblksz)) -b size=$fsblksz >> $seqres.full 2>&1 _scratch_mount # fix the reserve block pool to a known size so that the enospc calculations # work out correctly. _scratch_resvblks 1024 >> $seqres.full 2>&1 -# on a 16MB filesystem, there's 32768x512byte blocks. used is: +# on a 16MB filesystem, there's 32768x$fsblkszbyte blocks. used is: # - 4944 in the log, # - 32+1 for the root inode cluster # - 4 for the AG header @@ -50,19 +51,25 @@ _scratch_resvblks 1024 >> $seqres.full 2>&1 # Filesystem 1K-blocks Used Available Use% Mounted on # /dev/ubdc 13912 13908 4 100% /mnt/scratch # -dd if=/dev/zero of=$SCRATCH_MNT/fred bs=512 count=25000 2>&1 | _filter_dd -dd if=/dev/zero of=$SCRATCH_MNT/fred2 bs=512 count=500 2>&1 | _filter_dd -dd if=/dev/zero of=$SCRATCH_MNT/fred3 bs=512 count=245 2>&1 | _filter_dd +blks=$(( ($(_get_available_space $SCRATCH_MNT) / $fsblksz) - 15 )) +test $blks -gt 1100 || _notrun "not enough space" +b1=$(echo $blks | sed -e 's/[0-9][0-9][0-9]$/000/g') +b2=$(echo $blks | sed -e 's/^[0-9][0-9]//g') +echo "blks: $blks b1: $b1 b2: $b2" >> $seqres.full +dd if=/dev/zero of=$SCRATCH_MNT/fred bs=$fsblksz count=$((b1 - 1000)) 2>&1 | _filter_dd +dd if=/dev/zero of=$SCRATCH_MNT/fred2 bs=$fsblksz count=$b2 2>&1 | _filter_dd +dd if=/dev/zero of=$SCRATCH_MNT/fred3 bs=$fsblksz count=$((blks - (b1 + b2))) 2>&1 | _filter_dd rm -f $SCRATCH_MNT/fred* echo "*** one file" # now try a single file of that size -dd if=/dev/zero of=$SCRATCH_MNT/fred bs=512 count=26745 2>&1 | _filter_dd +dd if=/dev/zero of=$SCRATCH_MNT/fred bs=$fsblksz count=$blks 2>&1 | _filter_dd #rm -f $SCRATCH_MNT/fred* echo "*** one file, a few bytes at a time" # now try a single file of that size -dd if=/dev/zero of=$SCRATCH_MNT/fred bs=15 count=$[26745/15*512] 2>&1 | _filter_dd +dd if=/dev/zero of=$SCRATCH_MNT/fred bs=15 count=$[blks/15*$fsblksz] 2>&1 | _filter_dd +echo space: $(_get_available_space $SCRATCH_MNT) >> $seqres.full # success, all done echo "*** done" From patchwork Thu Nov 1 23:19:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10664681 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 EED6B17DB for ; Thu, 1 Nov 2018 23:19:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA69D2C515 for ; Thu, 1 Nov 2018 23:19:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CCB0F2C526; Thu, 1 Nov 2018 23:19:54 +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=ham 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 64FC12C515 for ; Thu, 1 Nov 2018 23:19:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728154AbeKBIYz (ORCPT ); Fri, 2 Nov 2018 04:24:55 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:53364 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727749AbeKBIYz (ORCPT ); Fri, 2 Nov 2018 04:24:55 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wA1NJ9Jd134495; Thu, 1 Nov 2018 23:19:51 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=PEIfZdgr2y9KosP2YosdSg/6pJqh7kIPR+BDM7Q/B3Y=; b=VIsQ1KTksw0kPeVJqGEklA1XgrnFLOVkyGszh/4mgiO9NSrDz8gVLjsnHuiOe2dj8Bzt Zf28C1Kzf/VOqx6RBtuDlQdmq4eX54YhYdEnmMYmx4f1v3GDWhiJarmNCEjs2phNmOC5 ObT2FxaC+pBZuee8EvStWL2aW/MEj5W5opfkaLUoiDdjJFVs2G4k1rYoTwo2bfc3MACy 2mZ6dj5Y5T/CCyKShDKcIa/FoHJdxOVvLAf8tZo2aSTB4AOUWXc/ovrtSgi2Gy4AabEu vDYjPy7x6qjhwoxdpNg0V6RbTP+UNBpkSQ1EwIwh294wwrcElxJhpC4th9x2IEuRt+P0 Mw== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2ncfyqbpsy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Nov 2018 23:19:51 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wA1NJoPr011536 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 1 Nov 2018 23:19:51 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wA1NJm2D030901; Thu, 1 Nov 2018 23:19:48 GMT Received: from localhost (/10.145.178.77) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 01 Nov 2018 16:19:47 -0700 Subject: [PATCH 7/8] misc: force the exact quota options coded into the test From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Thu, 01 Nov 2018 16:19:46 -0700 Message-ID: <154111438630.6577.12698243646066699280.stgit@magnolia> In-Reply-To: <154111434286.6577.15010861884505931015.stgit@magnolia> References: <154111434286.6577.15010861884505931015.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9064 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1811010194 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong Several tests require setting exactly the quota mount options that are encoded in the test. Unfortunately, quota mount options set by the user in MOUNT_OPTIONS can turn on other quota types, which causes the golden outputs to be off for various reasons (quota report output, behavior changes, etc.) So use _qmount_option to delete all the quota mount options in these tests so that the test itself can run with exactly the config for which it was written. Signed-off-by: Darrick J. Wong --- tests/generic/230 | 3 +++ tests/xfs/075 | 4 ++++ tests/xfs/116 | 3 +++ tests/xfs/132 | 5 +++++ tests/xfs/220 | 3 +++ 5 files changed, 18 insertions(+) diff --git a/tests/generic/230 b/tests/generic/230 index 66b12d2f..e0a876ba 100755 --- a/tests/generic/230 +++ b/tests/generic/230 @@ -99,6 +99,9 @@ rm -f $seqres.full grace=2 +# Test only the quota type specified in each _scratch_mount clause below. +_qmount_option 'defaults' + _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount "-o usrquota,grpquota" BLOCK_SIZE=$(_get_file_block_size $SCRATCH_MNT) diff --git a/tests/xfs/075 b/tests/xfs/075 index caf612bb..dee01462 100755 --- a/tests/xfs/075 +++ b/tests/xfs/075 @@ -25,12 +25,16 @@ _cleanup() # get standard environment, filters and checks . ./common/rc . ./common/filter +. ./common/quota # real QA test starts here _supported_fs xfs _supported_os Linux _require_scratch +# norecovery mounts do not succeed with quotas eanbled, so shut them off +_qmount_option "defaults" + echo "Silence is golden" _scratch_mkfs_sized $((512 * 1024 * 1024)) >$seqres.full diff --git a/tests/xfs/116 b/tests/xfs/116 index 6887d7e5..4422eb50 100755 --- a/tests/xfs/116 +++ b/tests/xfs/116 @@ -36,6 +36,9 @@ _supported_os Linux _require_scratch _require_xfs_quota +# Only mount with the quota options we specify below +_qmount_option "defaults" + _scratch_mkfs >/dev/null 2>&1 _scratch_mount "-o uquota" _scratch_unmount diff --git a/tests/xfs/132 b/tests/xfs/132 index c5fe8b5a..a421f727 100755 --- a/tests/xfs/132 +++ b/tests/xfs/132 @@ -24,6 +24,7 @@ _cleanup() # get standard environment, filters and checks . ./common/rc . ./common/filter +. ./common/quota # remove previous $seqres.full before test rm -f $seqres.full @@ -43,6 +44,10 @@ _disable_dmesg_check _require_xfs_mkfs_crc _scratch_mkfs -m crc=0 > $seqres.full 2>&1 +# The files that EIO in the golden output changes if we have quotas enabled +# so leave it off. +_qmount_option "defaults" + # corrupt an inode in the root inode chunk root_ino=$(_scratch_xfs_get_metadata_field 'rootino' 'sb 0') corrupt_ino=$((root_ino + 15)) diff --git a/tests/xfs/220 b/tests/xfs/220 index 227d5452..61319c9d 100755 --- a/tests/xfs/220 +++ b/tests/xfs/220 @@ -36,6 +36,9 @@ _supported_os Linux _require_scratch _require_quota +# Only mount with the specific quota options mentioned below +_qmount_option "defaults" + echo "Silence is golden." # create scratch filesystem From patchwork Thu Nov 1 23:19:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10664685 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 C341714E2 for ; Thu, 1 Nov 2018 23:20:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B05022C526 for ; Thu, 1 Nov 2018 23:20:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F44B2C524; Thu, 1 Nov 2018 23:20:03 +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=ham 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 47FD12C524 for ; Thu, 1 Nov 2018 23:20:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728164AbeKBIZE (ORCPT ); Fri, 2 Nov 2018 04:25:04 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:54642 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727749AbeKBIZE (ORCPT ); Fri, 2 Nov 2018 04:25:04 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wA1NJ2YH087597; Thu, 1 Nov 2018 23:20:01 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=p3sHXLbHLJJvUb23wbipcMmFlwL2JyBtK/D5yaJmuD8=; b=2MP+E5T/+lWAVdNBZDqKG/XYqb5vWBqaR9o+QWZwjAtcTfGGD6J7uqQNDBgfIWqQRKsE O3LAEMDicbOdr5pqUjSQEDo45KQaUxqBM8YxbtagFq0DqNAINmPSG/Snu/3EjZomcdYL QiyXArqY5PaFXh+3aqsX0SplSRgsk3+BEGcPInkgkeA4ULervebwJKzJ2vEUR4q7i7Te BS8mmbdEo5QvDTUFRhGVrFy069B6b2NUg4btrj/zHJhFDwXUuBeVB2LwxMMlpUMN6EEF 5J+vLpxXrATJLs6DQkZ7+AJxZ4A9SmGJ9g2JO743xYg/rITDA58u7mAfTyoG1JntB1WO Vw== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2ncgnrbq6e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Nov 2018 23:20:00 +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 wA1NJsRZ003000 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 1 Nov 2018 23:19:55 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wA1NJsvA005917; Thu, 1 Nov 2018 23:19:54 GMT Received: from localhost (/10.145.178.77) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 01 Nov 2018 16:19:54 -0700 Subject: [PATCH 8/8] xfs: filter out mount options that don't work on v4 filesystems From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Thu, 01 Nov 2018 16:19:52 -0700 Message-ID: <154111439271.6577.9895278106106014415.stgit@magnolia> In-Reply-To: <154111434286.6577.15010861884505931015.stgit@magnolia> References: <154111434286.6577.15010861884505931015.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9064 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1811010194 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong A few tests require v4 filesystems and enforce this by disabling crc's in the _scratch_mkfs call. However, if the user specified MOUNT_OPTIONS that only work with v5 filesystems, these tests fail. If we detect a test creating a v4 scratch filesystem, filter out incompatible mount options that don't work on v4, such as simultaneous group/project quota. Signed-off-by: Darrick J. Wong --- common/xfs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/common/xfs b/common/xfs index 80340b0d..484e6ab6 100644 --- a/common/xfs +++ b/common/xfs @@ -89,6 +89,7 @@ _scratch_mkfs_xfs() _scratch_do_mkfs "$mkfs_cmd" "$mkfs_filter" $* 2>$tmp.mkfserr 1>$tmp.mkfsstd mkfs_status=$? + grep -q crc=0 $tmp.mkfsstd && _force_xfsv4_mount_options if [ $mkfs_status -eq 0 -a "$LARGE_SCRATCH_DEV" = yes ]; then # manually parse the mkfs output to get the fs size in bytes @@ -779,3 +780,26 @@ _scratch_get_bmx_prefix() { _scratch_xfs_db -c "inode ${ino}" -c 'p' >> $seqres.full return 1 } + +# +# Ensures that we don't pass any mount options incompatible with XFS v4 +# +_force_xfsv4_mount_options() +{ + local gquota=0 + local pquota=0 + + # Can't have group and project quotas in XFS v4 + echo "$MOUNT_OPTIONS" | egrep -q "(gquota|grpquota|grpjquota=|gqnoenforce)" && gquota=1 + echo "$MOUNT_OPTIONS" | egrep -q "(\bpquota|prjquota|pqnoenforce)" && pquota=1 + + if [ $gquota -gt 0 ] && [ $pquota -gt 0 ]; then + export MOUNT_OPTIONS=$(echo $MOUNT_OPTIONS \ + | sed -e 's/gquota/QUOTA/g' \ + -e 's/grpquota/QUOTA/g' \ + -e 's/grpjquota=[^, ]/QUOTA/g' \ + -e 's/gqnoenforce/QUOTA/g' \ + -e "s/QUOTA/defaults/g") + fi + echo "MOUNT_OPTIONS = $MOUNT_OPTIONS" >>$seqres.full +}