From patchwork Thu Nov 15 06:04:34 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: 10683571 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 3BB5D17F3 for ; Thu, 15 Nov 2018 06:04:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2980A2B4CE for ; Thu, 15 Nov 2018 06:04:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1DF0E2C198; Thu, 15 Nov 2018 06:04:38 +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 B58052B4CE for ; Thu, 15 Nov 2018 06:04:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726960AbeKOQLE (ORCPT ); Thu, 15 Nov 2018 11:11:04 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:47532 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727067AbeKOQLD (ORCPT ); Thu, 15 Nov 2018 11:11:03 -0500 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 wAF63wlS148427 for ; Thu, 15 Nov 2018 06:04:36 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=e8sdN/iHuTSKoWEg2Dq5wHZWPVN6k8nsLHZ/mVAvNyk=; b=bVY1sss2ThK2V/+C4In9PxZuGcA6fXTZQlKDO4L9VtHrajwNJW9tuAfmYc0OFgh3n6Tv X9oEI7b14p31+rrCT1Kf89N9WviNQwaqIhvfj2aRpNbBCV0UATCjlOAo2rm22EPHDeoX 1hODtwVXJIWRLpuqbXNK0KsJJHSl0S0vnDRrqpQkdgQTO/vEGWOqQxv0h7SqVtQXtsyU xZq7lXMCx98Mgl+SgxMh6U6rEEYH4Ujf56uyIKEs6cgZxd0jAlM0IA5XlJYE2MwO/RHz DF3p9Kt5LRSgLvC64ss5XyvmAywZoKqFSWHv7CfE6n5ck2pRUFDHsVENpiTZJlBSVjSw tQ== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2nr7cs7jjq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 15 Nov 2018 06:04:36 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wAF64ZUr021755 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 15 Nov 2018 06:04:35 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wAF64ZKW027534 for ; Thu, 15 Nov 2018 06:04:35 GMT Received: from localhost (/10.159.153.160) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 14 Nov 2018 22:04:35 -0800 Subject: [PATCH 2/9] xfs: never try to scrub more than 64 inodes per inobt record From: "Darrick J. Wong" To: darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org Date: Wed, 14 Nov 2018 22:04:34 -0800 Message-ID: <154226187415.13280.16593356573868407559.stgit@magnolia> In-Reply-To: <154226186169.13280.4536602352984659736.stgit@magnolia> References: <154226186169.13280.4536602352984659736.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9077 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=820 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811150055 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 we never check more than XFS_INODES_PER_CHUNK inodes for any given inobt record since there can be more than one inobt record mapped to an inode cluster. Signed-off-by: Darrick J. Wong --- fs/xfs/scrub/ialloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/xfs/scrub/ialloc.c b/fs/xfs/scrub/ialloc.c index 31ec0c16be4a..b06a0b4de070 100644 --- a/fs/xfs/scrub/ialloc.c +++ b/fs/xfs/scrub/ialloc.c @@ -203,7 +203,8 @@ xchk_iallocbt_check_freemask( int error = 0; /* Make sure the freemask matches the inode records. */ - nr_inodes = mp->m_inodes_per_cluster; + nr_inodes = min_t(unsigned int, XFS_INODES_PER_CHUNK, + mp->m_inodes_per_cluster); for (agino = irec->ir_startino; agino < irec->ir_startino + XFS_INODES_PER_CHUNK;