From patchwork Sat Feb 16 00:41:19 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: 10816113 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 1BF8617E0 for ; Sat, 16 Feb 2019 00:41:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B23A2FFF0 for ; Sat, 16 Feb 2019 00:41:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F37CB2FFF8; Sat, 16 Feb 2019 00:41:27 +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 A078F2FFF0 for ; Sat, 16 Feb 2019 00:41:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403979AbfBPAl0 (ORCPT ); Fri, 15 Feb 2019 19:41:26 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:34510 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726145AbfBPAl0 (ORCPT ); Fri, 15 Feb 2019 19:41:26 -0500 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 x1G0Xj3e029134; Sat, 16 Feb 2019 00:41:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=v6XHpF7FAE6tWsJOFm+QwE8BpGI2eP9693mH0DU7ZUo=; b=LXmKZP1onbmI31W+5/H05NJoK9HMjzf4PgPWiEKBrHXyzmjtQoYKZTAhydn8gYkecoOX X/V62zZU+5own5wk86Tg0KH3+8+J59b5Xiwm1x4y4S/PoUNIYKCKC7IAUCQhCAenFqlr jVa4LBD0E9HuqgmzAO3NzbgjuZnSnUoa7JgPPN1OOeY94RxAg+HB1szja3Q1EOTDSNfR 7YPWUPQHlMFoQga0hdhI1ibgMcfURqhavyFPKwFwB36mwvKNLAHQxtB04XHvF+gKjOIw uq6bM6nQ3mYz4yoYDp+bLTc4eIV6PCT0n/pBHxBVVH0m6ouvI1nVdxMhDS5zBowhhHQj Og== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2qhrem0mx3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 16 Feb 2019 00:41:21 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x1G0fLx5030734 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 16 Feb 2019 00:41:21 GMT Received: from abhmp0020.oracle.com (abhmp0020.oracle.com [141.146.116.26]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x1G0fKdm032212; Sat, 16 Feb 2019 00:41:21 GMT Received: from localhost (/10.145.178.102) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 16 Feb 2019 00:41:20 +0000 Date: Fri, 15 Feb 2019 16:41:19 -0800 From: "Darrick J. Wong" To: Eric Sandeen Cc: xfs , fstests , Eryu Guan Subject: [PATCH] xfs: test mkfs extent size hint validation Message-ID: <20190216004119.GW32253@magnolia> References: <20190216003923.GV32253@magnolia> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190216003923.GV32253@magnolia> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9168 signatures=668683 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-1902160001 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 mkfs won't format filesystems that fail extent size hint validation. Signed-off-by: Darrick J. Wong --- tests/xfs/738 | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/738.out | 2 ++ tests/xfs/group | 1 + 3 files changed, 51 insertions(+) create mode 100755 tests/xfs/738 create mode 100644 tests/xfs/738.out diff --git a/tests/xfs/738 b/tests/xfs/738 new file mode 100755 index 00000000..ee0ffaae --- /dev/null +++ b/tests/xfs/738 @@ -0,0 +1,48 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2019 Oracle, Inc. All Rights Reserved. +# +# FS QA Test No. 738 +# +# Make sure we can't format a filesystem with insane extent hints. +# +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" +tmp=/tmp/$$ +status=1 # failure is the default! +testfile=$TEST_DIR/$seq.txt +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc + +# real QA test starts here +_supported_fs xfs +_supported_os Linux +_require_scratch_nocheck + +rm -f $seqres.full + +# Try regular extent size hint +echo extszinherit >> $seqres.full +_scratch_mkfs -d extszinherit=8388608 >> $seqres.full 2>&1 +test $? -eq 1 || echo "should have failed extszinherit" + +# Try cow extent size hint if supported +$MKFS_XFS_PROG -N -f $SCRATCH_DEV > $tmp.mkfs +if grep -q 'reflink=' $tmp.mkfs ; then + echo cowextsize >> $seqres.full + _scratch_mkfs -m reflink=1 -d cowextsize=8388608 >> $seqres.full 2>&1 + test $? -eq 1 || echo "should have failed cowextsize" +fi + +echo silence is golden +status=0 +exit diff --git a/tests/xfs/738.out b/tests/xfs/738.out new file mode 100644 index 00000000..703fe23b --- /dev/null +++ b/tests/xfs/738.out @@ -0,0 +1,2 @@ +QA output created by 738 +silence is golden diff --git a/tests/xfs/group b/tests/xfs/group index 677396fb..b2fea9ef 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -515,6 +515,7 @@ 731 dangerous_scrub dangerous_online_repair 736 auto quick unlink 737 auto quick unlink +738 auto quick 1500 auto prealloc rw 1501 auto prealloc rw 1502 auto prealloc rw