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