From patchwork Thu Mar 14 21:05:53 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: 10853625 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 C348917E6 for ; Thu, 14 Mar 2019 21:05:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA8AC283B2 for ; Thu, 14 Mar 2019 21:05:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A91432A790; Thu, 14 Mar 2019 21:05:57 +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 55C40283B2 for ; Thu, 14 Mar 2019 21:05:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727935AbfCNVF5 (ORCPT ); Thu, 14 Mar 2019 17:05:57 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:52194 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727625AbfCNVF4 (ORCPT ); Thu, 14 Mar 2019 17:05:56 -0400 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 x2EKwuoh095452; Thu, 14 Mar 2019 21:05:54 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=6xHrwya6Xf4x+5xVR9m8GJa49gQncdFMAfo56f/gza8=; b=bBF0QJyQ3D7qRj/O1Cjx2zMxQGfYYzm01DhYRjsky+a6ToMOovHm3QLg1nP9kSHmjvAI 3q5kl98LwWAngFdkIL9Ja53JXr2bOgwy+4PcMGOgQ2oG24Ytyplfrwe9ZkBgk2bVBaOL PSu86L7DlioDW1vzB41985tVcpUC4c9QdXL2ZiBJ0E5r68KhBcj4W/PobCW2+wJqbGta xDBV1W1p8WcP4o7K0IZ2uBmZ7/ItAxpqnrFjU+DUkJIAAuE0DU5rdKaI9iKsR8t8nlIZ zJtXe7gAGy8HwLbKmu7IWo3ReLqzZON4BuJv9lQflpZm/55yPYBonmpf5Z5mSya1FfW0 Ag== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2r44wukfp1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Mar 2019 21:05:54 +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 x2EL5sXA000761 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Mar 2019 21:05:54 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x2EL5rkb003561; Thu, 14 Mar 2019 21:05:54 GMT Received: from localhost (/10.145.178.102) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 14 Mar 2019 21:05:53 +0000 Subject: [PATCH 20/36] xfs_db: fix finobt record decoding when sparse inodes enabled From: "Darrick J. Wong" To: sandeen@sandeen.net, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org Date: Thu, 14 Mar 2019 14:05:53 -0700 Message-ID: <155259755345.31886.7689089384611545119.stgit@magnolia> In-Reply-To: <155259742281.31886.17157720770696604377.stgit@magnolia> References: <155259742281.31886.17157720770696604377.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9195 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=2 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-1903140143 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 Use the sparse inobt record field decoder (inobt_spcrc_hfld) to decode finobt records when sparse inodes are enabled. Otherwise, xfs_db prints out bogus things like: recs[1] = [startino,freecount,free] 1:[214720,16429,0xfffffffffff80000] There can never be 16429 records in an inode btree record; instead it should print: recs[1] = [startino,holemask,count,freecount,free] 1:[214720,0,64,45,0xfffffffffff80000] Signed-off-by: Darrick J. Wong --- db/type.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/type.c b/db/type.c index f5f65042..d42935a2 100644 --- a/db/type.c +++ b/db/type.c @@ -107,7 +107,7 @@ static const typ_t __typtab_crc[] = { { TYP_SYMLINK, "symlink", handle_struct, symlink_crc_hfld, &xfs_symlink_buf_ops, XFS_SYMLINK_CRC_OFF }, { TYP_TEXT, "text", handle_text, NULL, NULL, TYP_F_NO_CRC_OFF }, - { TYP_FINOBT, "finobt", handle_struct, inobt_crc_hfld, + { TYP_FINOBT, "finobt", handle_struct, inobt_spcrc_hfld, &xfs_inobt_buf_ops, XFS_BTREE_SBLOCK_CRC_OFF }, { TYP_NONE, NULL } };