From patchwork Tue Dec 18 20:36:16 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: 10736271 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 3B26813BF for ; Tue, 18 Dec 2018 20:36:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24ABF2AE19 for ; Tue, 18 Dec 2018 20:36:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 158192AE25; Tue, 18 Dec 2018 20:36:34 +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 AB31A2AE19 for ; Tue, 18 Dec 2018 20:36:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726988AbeLRUgc (ORCPT ); Tue, 18 Dec 2018 15:36:32 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:54772 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727290AbeLRUgV (ORCPT ); Tue, 18 Dec 2018 15:36:21 -0500 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 wBIKYkN7104696; Tue, 18 Dec 2018 20:36:19 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=ZkwcDWdjE+VkfZ0Xmy1+tK5P94PD/7BZnlGXjXwlIJtVeXBosKtBG1IU4SAuzpnSJFid DYNE5qowH/XoTEi7QQY2o8rQzNr0b9eb9IntpV78WDLACIyoxw4MEZRg2HVRuPm2sQ9c nxVqDutrJ3I5Rd74kMZLcK3rSiE07AtjBVJfrPO/DqMOd37buKzcbNr5pGq6Mmox2Rtz gp2IcfDOov+TKNFaBquPQ+S6x6dAg6UnWq67H7Acmy4sWtMyy7cV8liHCPdJzh0EPhXW lBGUSRGdV0AJ7T6JttEKqDBOxdjqVNBwMCSh+Lhds5AaZacgYRl6UIytima/KgMeOTh8 Gg== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2pct8qwn1b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Dec 2018 20:36:18 +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 wBIKaHPF009263 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Dec 2018 20:36:18 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wBIKaHlR028789; Tue, 18 Dec 2018 20:36:17 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 18 Dec 2018 12:36:17 -0800 Subject: [PATCH 5/5] 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: Tue, 18 Dec 2018 12:36:16 -0800 Message-ID: <154516537610.31115.1785062537646476692.stgit@magnolia> In-Reply-To: <154516534392.31115.7010578395334646479.stgit@magnolia> References: <154516534392.31115.7010578395334646479.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9111 signatures=668680 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-1810050000 definitions=main-1812180170 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 +}