From patchwork Wed Oct 18 23:37:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10015579 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BFBD6600CC for ; Wed, 18 Oct 2017 23:37:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0B3128C2A for ; Wed, 18 Oct 2017 23:37:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A57FF28C49; Wed, 18 Oct 2017 23:37:43 +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=-6.9 required=2.0 tests=BAYES_00, 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 157B728C2A for ; Wed, 18 Oct 2017 23:37:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751264AbdJRXhl (ORCPT ); Wed, 18 Oct 2017 19:37:41 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:38671 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751007AbdJRXhk (ORCPT ); Wed, 18 Oct 2017 19:37:40 -0400 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v9INbcZ2010114 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Oct 2017 23:37:39 GMT 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 v9INbbwX022060 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Oct 2017 23:37:38 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v9INbbYj007670; Wed, 18 Oct 2017 23:37:37 GMT Received: from localhost (/73.25.142.12) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 18 Oct 2017 16:37:37 -0700 Subject: [PATCH 1/5] quota: clear speculative delalloc when checking quota usage From: "Darrick J. Wong" To: eguan@redhat.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Wed, 18 Oct 2017 16:37:36 -0700 Message-ID: <150836985643.27213.927427950548904105.stgit@magnolia> In-Reply-To: <150836985024.27213.3715197937819365388.stgit@magnolia> References: <150836985024.27213.3715197937819365388.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Source-IP: userv0021.oracle.com [156.151.31.71] 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 Occasionally speculative preallocation kicks in when writing files to a filesystem under test. These preallocations consume quota and /usually/ aren't around after we drop_caches, but there's nothing to guarantee that they actually have, so the quota reports will be different before and after the fs remount, causing sporadic test failures in generic/{23[123],270}. We now have xfs_spaceman which can instruct XFS to forcibly remove the speculative preallocations. This fixes the sporadic failures, at least for XFS. Signed-off-by: Darrick J. Wong --- common/config | 1 + common/quota | 6 ++++++ 2 files changed, 7 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/common/config b/common/config index 8844173..96503c6 100644 --- a/common/config +++ b/common/config @@ -149,6 +149,7 @@ export XFS_LOGPRINT_PROG="`set_prog_path xfs_logprint`" export XFS_REPAIR_PROG="`set_prog_path xfs_repair`" export XFS_DB_PROG="`set_prog_path xfs_db`" export XFS_GROWFS_PROG=`set_prog_path xfs_growfs` +export XFS_SPACEMAN_PROG="`set_prog_path xfs_spaceman`" export XFS_SCRUB_PROG="`set_prog_path xfs_scrub`" export XFS_PARALLEL_REPAIR_PROG="`set_prog_path xfs_prepair`" export XFS_PARALLEL_REPAIR64_PROG="`set_prog_path xfs_prepair64`" diff --git a/common/quota b/common/quota index d027a8c..2611c48 100644 --- a/common/quota +++ b/common/quota @@ -267,6 +267,12 @@ _check_quota_usage() VFS_QUOTA=1 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 + ;; *) ;; esac