From patchwork Tue Dec 18 20:35:57 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: 10736259 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 AF4FE14E5 for ; Tue, 18 Dec 2018 20:36:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A25B62AE19 for ; Tue, 18 Dec 2018 20:36:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 96EC42AE27; Tue, 18 Dec 2018 20:36:04 +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 4AF0E2AE1D for ; Tue, 18 Dec 2018 20:36:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727472AbeLRUgC (ORCPT ); Tue, 18 Dec 2018 15:36:02 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:54550 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727366AbeLRUgB (ORCPT ); Tue, 18 Dec 2018 15:36:01 -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 wBIKYRAR104566; Tue, 18 Dec 2018 20:35:59 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=tLatF7cu6PbCNOCPRUHbdeM3KtGxZYxweNlEVswJi40=; b=rkr+3P6Zd+MQic9+Xqa+DVOkDRzSaaR3gL7/DgrlQOA9Jpd9xsQCqMs5UVwNa/7ROscZ 149IAB7s0AOXRCTlstuvROUN2ghFQnN07ccRbgF/gZk52mlLebU97x7WB6i9cFGko71P yx5+2sRsOamcoYgevjYaKzRzcGWiAqceGWUZQVVZUdMBq+6em6fl2DU+oZM5an7vOmY6 RBQ0PwgsuKVskmV8dJ4IGtHaZmOD3Ntz+j7w0ROlutXRbLoXnD2hhnaOnMYVVNvma2bL iXYW3ZHDdZc0bx3E1FymPnZUvFoYzHUvjVi4h8dk/d6UV2AGsxKRtu6C2vUtmt6lG+iL Ng== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2pct8qwmyj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Dec 2018 20:35:59 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wBIKZwfa014207 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Dec 2018 20:35:59 GMT Received: from abhmp0020.oracle.com (abhmp0020.oracle.com [141.146.116.26]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wBIKZwrc028616; Tue, 18 Dec 2018 20:35:58 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 18 Dec 2018 12:35:58 -0800 Subject: [PATCH 2/5] xfs/123: fix remote symlink block size calculation 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:35:57 -0800 Message-ID: <154516535699.31115.15359236623997726880.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: 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 In this test we try to create a remote symlink block by creating a symlink target buffer large enough to exceed the size of an inode. Unfortunately we don't use the correct block size or symlink header size, which on a 1k block filesystem causes there to be two remote blocks. This causes crc verification errors in xfs_db (because it's too dumb to load both blocks as one like the kernel does) which we don't care about because we're about to corrupt the block anyway. So, fix the block size calculation so that we end up with one block. Signed-off-by: Darrick J. Wong --- tests/xfs/123 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/xfs/123 b/tests/xfs/123 index 8a494ef9..f45e94bf 100755 --- a/tests/xfs/123 +++ b/tests/xfs/123 @@ -46,11 +46,12 @@ _scratch_mkfs_xfs > /dev/null echo "+ mount fs image" _scratch_mount -blksz=1000 +blksz=1024 echo "+ make some files" echo "file contents: moo" > "${SCRATCH_MNT}/x" -str="$(perl -e "print './' x $(( (blksz / 2) - 16));")x" +reps=$(( (blksz - (56 + 1)) / 2 )) +str="$(perl -e "print './' x $reps;")x" (cd $SCRATCH_MNT; ln -s "${str}" "long_symlink") cat "${SCRATCH_MNT}/long_symlink" inode="$(stat -c '%i' "${SCRATCH_MNT}/long_symlink")" @@ -60,7 +61,7 @@ echo "+ check fs" _scratch_xfs_repair -n >> $seqres.full 2>&1 || _fail "xfs_repair should not fail" echo "+ corrupt image" -_scratch_xfs_db -x -c "inode ${inode}" -c "dblock 0" -c "stack" -c "blocktrash -x 32 -o 256 -y $((blksz * 8)) -z ${FUZZ_ARGS}" >> $seqres.full +_scratch_xfs_db -x -c "inode ${inode}" -c "dblock 0" -c "stack" -c "blocktrash -x 32 -o 256 -y $((blksz * 4)) -z ${FUZZ_ARGS}" >> $seqres.full echo "+ mount image" if _try_scratch_mount >> $seqres.full 2>&1; then