From patchwork Wed Jul 4 04:51:06 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: 10505831 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 004C6601D7 for ; Wed, 4 Jul 2018 04:51:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DEA5628C40 for ; Wed, 4 Jul 2018 04:51:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D2B1228C7E; Wed, 4 Jul 2018 04:51:13 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, 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 AB6A328C40 for ; Wed, 4 Jul 2018 04:51:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932439AbeGDEvM (ORCPT ); Wed, 4 Jul 2018 00:51:12 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:49432 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932270AbeGDEvK (ORCPT ); Wed, 4 Jul 2018 00:51:10 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w644mure026069; Wed, 4 Jul 2018 04:51:08 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-2017-10-26; bh=TPQ0nz5cVH64rMZdmDX/FZ58fPN4IQQbrWpTV5uxlYY=; b=q8IEMGLtfSlf7C1Ab/LcKx5NnlWCpcBq8JMZKCEkliWiZnRqI3wTsBpqoCZRZa0A3whj 7EH7GFj+eLnMuhzQ53+WEWq83jMPZh73eHlM5+8mGLtc+HbEkzG5EUDPdzfVcHOYyAzU 85pu7aD2QTpdl1XiHq0Dxz9668dUqkq8j8vOqSk4fizcuzzW8v1aDJnmankW9zgU7+bj uQqb/uihePq6fLqVLLzI+YbaXIlJCz5AjF5qMyix5F3mE99x1wJRHz/YFkfW+WmsgpYP nDB4qe1QskHmQ/SS1zgupMrY2sFJqsi6kb/e271MM/poHLheSZTanUVjvflD1CicXT2x Vg== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2k0dnjh8qr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 04 Jul 2018 04:51:08 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w644p7jt005056 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 4 Jul 2018 04:51:07 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w644p7VM028643; Wed, 4 Jul 2018 04:51:07 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 03 Jul 2018 21:51:07 -0700 Subject: [PATCH 3/7] xfs/001: update to handle 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: Tue, 03 Jul 2018 21:51:06 -0700 Message-ID: <153067986635.28393.2430588973298698151.stgit@magnolia> In-Reply-To: <153067984748.28393.1595618163831671652.stgit@magnolia> References: <153067984748.28393.1595618163831671652.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8943 signatures=668704 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=716 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807040056 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 xfs/001 fuzzes various extent fields using xfs_db. There's nothing in it that's specific to v4 filesystems, so upgrade the test to be able to handle v5 filesystems. Signed-off-by: Darrick J. Wong --- common/xfs | 15 +++++++++++++++ tests/xfs/001 | 18 ++++++++++++------ 2 files changed, 27 insertions(+), 6 deletions(-) -- 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/xfs b/common/xfs index 9a785b88..5b632df1 100644 --- a/common/xfs +++ b/common/xfs @@ -765,3 +765,18 @@ _scratch_get_sfdir_prefix() { _scratch_xfs_db -c "inode ${dir_ino}" -c 'p' >> $seqres.full return 1 } + +_scratch_get_bmx_prefix() { + local ino="$1" + + for prefix in "u3.bmx" "u.bmx"; do + if [ -n "$(_scratch_xfs_get_metadata_field \ + "${prefix}[0].startblock" \ + "inode ${ino}")" ]; then + echo "${prefix}" + return 0 + fi + done + _scratch_xfs_db -c "inode ${ino}" -c 'p' >> $seqres.full + return 1 +} diff --git a/tests/xfs/001 b/tests/xfs/001 index ac86c3b1..6ad3aba8 100755 --- a/tests/xfs/001 +++ b/tests/xfs/001 @@ -49,9 +49,8 @@ _do_bit_test() _supported_fs xfs _supported_os Linux _require_scratch_nocheck -_require_xfs_mkfs_crc -_scratch_mkfs -m crc=0 >/dev/null 2>&1 +_scratch_mkfs >/dev/null 2>&1 _scratch_mount # create the test file @@ -68,11 +67,18 @@ BMBT_STARTOFF_BITLEN=54 BMBT_STARTBLOCK_BITLEN=52 BMBT_BLOCKCOUNT_BITLEN=21 +prefix=$(_scratch_get_bmx_prefix $FILE_INO) +test -n "$prefix" || _fail "could not find bmx prefix from inode $FILE_INO" + +filter_output() { + sed -e "s/${prefix}/u.bmx/g" +} + # test setting the BMBT entries from 0 to past the valid number. -_do_bit_test "u.bmx[0].extentflag" $BMBT_EXNTFLAG_BITLEN -_do_bit_test "u.bmx[0].startoff" $BMBT_STARTOFF_BITLEN -_do_bit_test "u.bmx[0].startblock" $BMBT_STARTBLOCK_BITLEN -_do_bit_test "u.bmx[0].blockcount" $BMBT_BLOCKCOUNT_BITLEN +_do_bit_test "${prefix}[0].extentflag" $BMBT_EXNTFLAG_BITLEN | filter_output +_do_bit_test "${prefix}[0].startoff" $BMBT_STARTOFF_BITLEN | filter_output +_do_bit_test "${prefix}[0].startblock" $BMBT_STARTBLOCK_BITLEN | filter_output +_do_bit_test "${prefix}[0].blockcount" $BMBT_BLOCKCOUNT_BITLEN | filter_output # test setting the 32 bit generation number _scratch_xfs_db -x -c "inode $FILE_INO" -c "write core.gen 0x5a" _scratch_xfs_db -x -c "inode $FILE_INO" -c "write core.gen 0xa5"