From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CE94C433FE for ; Mon, 7 Dec 2020 18:53:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E62E4238E4 for ; Mon, 7 Dec 2020 18:53:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725852AbgLGSxh (ORCPT ); Mon, 7 Dec 2020 13:53:37 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:33394 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725994AbgLGSxh (ORCPT ); Mon, 7 Dec 2020 13:53:37 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0B7ITE8q189606; Mon, 7 Dec 2020 18:52:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=dNDord2mBSWe4ClXntkwVezGRRpq7xauywptCs/j7Zs=; b=fTPsB6O3mDUeS6vFQeuCjY19amGCWFu4zit+4EbY4Uq9nr6ycItKRx0BHvZDC5PNJqNk 1ICAzfL+vdqFab6nElEPP0zht8M1OBNZrumRzychHG+oWyisc1KPR0qNOqCL5q6Rs8ze FAibkdf7y0trYAS1A/YZGMUWLqRYSiB6He2iw9Ev46sVWmaK62VymeN/a+ubuoGG5Bif KfJTrO3G/rmBGo8dKNUTqr7aHn7SHNnpic3RFZoXNk9wN0FCFc18V2og53tRDbVzkfAD ZaFpR+H+1RM+friVUl87A1lgSPuPuVLDrZy2cqU6REtjz9Ju079qQJHYUQctXL0IWvBN PQ== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 35825kxxyw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 07 Dec 2020 18:52:52 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0B7IoROQ085902; Mon, 7 Dec 2020 18:52:51 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3020.oracle.com with ESMTP id 358m3wred6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 07 Dec 2020 18:52:51 +0000 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 0B7IqoTu018874; Mon, 7 Dec 2020 18:52:50 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 07 Dec 2020 10:52:50 -0800 Date: Mon, 7 Dec 2020 10:52:47 -0800 From: "Darrick J. Wong" To: zlang@redhat.com, bugzilla-daemon@bugzilla.kernel.org Cc: linux-xfs@vger.kernel.org Subject: Re: [Bug 210535] New: [xfstests generic/466] XFS: Assertion failed: next_agino == irec->ir_startino + XFS_INODES_PER_CHUNK, file: fs/xfs/xfs_iwalk.c, line: 366 Message-ID: <20201207185247.GT629293@magnolia> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9828 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 adultscore=0 bulkscore=0 phishscore=0 suspectscore=0 mlxscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012070120 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9828 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 bulkscore=0 phishscore=0 mlxlogscore=999 clxscore=1011 priorityscore=1501 mlxscore=0 spamscore=0 lowpriorityscore=0 malwarescore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012070119 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org On Mon, Dec 07, 2020 at 05:14:26PM +0000, bugzilla-daemon@bugzilla.kernel.org wrote: > https://bugzilla.kernel.org/show_bug.cgi?id=210535 > > Bug ID: 210535 > Summary: [xfstests generic/466] XFS: Assertion failed: > next_agino == irec->ir_startino + > XFS_INODES_PER_CHUNK, file: fs/xfs/xfs_iwalk.c, line: > 366 > Product: File System > Version: 2.5 > Kernel Version: xfs-linux xfs-5.10-fixes-7 > Hardware: All > OS: Linux > Tree: Mainline > Status: NEW > Severity: normal > Priority: P1 > Component: XFS > Assignee: filesystem_xfs@kernel-bugs.kernel.org > Reporter: zlang@redhat.com > Regression: No > > Created attachment 294021 > --> https://bugzilla.kernel.org/attachment.cgi?id=294021&action=edit > generic-466.full > > xfstests generic/466 hit below assertion failure on power9 ppc64le: > > [16404.196161] XFS: Assertion failed: next_agino == irec->ir_startino + > XFS_INODES_PER_CHUNK, file: fs/xfs/xfs_iwalk.c, line: 366 Does this patch fix it? --D From: Darrick J. Wong Subject: [PATCH] xfs: fix the forward progress assertion in xfs_iwalk_run_callbacks In commit 27c14b5daa82 we started tracking the last inode seen during an inode walk to avoid infinite loops if a corrupt inobt record happens to have a lower ir_startino than the record preceeding it. Unfortunately, the assertion trips over the case where there are completely empty inobt records (which can happen quite easily on 64k page filesystems) because we advance the tracking cursor without actually putting the empty record into the processing buffer. Fix the assert to allow for this case. Reported-by: zlang@redhat.com Fixes: 27c14b5daa82 ("xfs: ensure inobt record walks always make forward progress") Signed-off-by: Darrick J. Wong --- fs/xfs/xfs_iwalk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/xfs_iwalk.c b/fs/xfs/xfs_iwalk.c index 2a45138831e3..eae3aff9bc97 100644 --- a/fs/xfs/xfs_iwalk.c +++ b/fs/xfs/xfs_iwalk.c @@ -363,7 +363,7 @@ xfs_iwalk_run_callbacks( /* Delete cursor but remember the last record we cached... */ xfs_iwalk_del_inobt(tp, curpp, agi_bpp, 0); irec = &iwag->recs[iwag->nr_recs - 1]; - ASSERT(next_agino == irec->ir_startino + XFS_INODES_PER_CHUNK); + ASSERT(next_agino >= irec->ir_startino + XFS_INODES_PER_CHUNK); error = xfs_iwalk_ag_recs(iwag); if (error)