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"