Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp128150iof; Sun, 5 Jun 2022 23:12:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxu0JuSugoNTyEXiy6X2UKjSeAqScX8ijE2YQwPQCpoBkFowdRYlD5N5KiaPVinPPopVKOw X-Received: by 2002:a17:90b:1b10:b0:1e8:2966:3232 with SMTP id nu16-20020a17090b1b1000b001e829663232mr18573622pjb.103.1654495941882; Sun, 05 Jun 2022 23:12:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654495941; cv=none; d=google.com; s=arc-20160816; b=x6J8HC8zj7hVgJ8TSioGbFSpqWi4N+TWRB8URR3p3eWTTiQnrCX6eeP4hSC7FMP9Hm ZfCk+RkBho6LHZ/wOpnLj4AoGl4eCDF7Msg2JJBX5oRewbUJbk/fGnyMLd88ys4OPqgc HMDiHYP4QESb5G32PCo5tQAqayzD1I/KBmDclEd70vWcJ2hNiHapIk99y9w00xRDOfJx yzVl2g89/e40u7QhaKRU9VvcEBVS+Sg9u5BfHwAI+yk7SX1eSjO30Ho0oR79j0CBJ3Tm +hLE3/OA41ndpaXCbQz1NdKjqxm6S/dZrwP5x2LviA0VFAn5CRBnJwyx+FfS7jaiEmwB iIxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DBRuRm2gjfhsfXuWPM0VrfH3F8KGknX4ELSFK2nIgQQ=; b=FMBrM0UsIPOuDYO6U6Px6AHiZcGM9FYy4nh/IEfwgsJ+SCdJWeUM4H0RJNYPJn097E jVRmguMOoypJ60Q9WblYuhd6vGXzwRYdFZ8+eBeFv1uItANSPUZRZ5i+RlkbKdRMsD6P SuHb5PVb54iEFommom/9GtCxf2t27Upap4BKvJH8N2I12IRyfGWEWGDrSIQ/rCat1arM vnzCf8dSwhJck1LU2Jjewml/kVnLuZOvVQqi/jVSnLxTKzDAmwPV4eETazdP6lm1BlJ0 EYvljPKVwSH6MtNtzC7Q2wXhEXiKtjovHL0blPkWxo8t2vCsVmHwMT/nuTZv77zvJ8pr mXAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SwYyg7s9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k17-20020a170902f29100b0016174c3d06bsi17333074plc.451.2022.06.05.23.12.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 23:12:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SwYyg7s9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 759D831D0D0; Sun, 5 Jun 2022 21:51:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346738AbiFCSFI (ORCPT + 99 others); Fri, 3 Jun 2022 14:05:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346589AbiFCRvS (ORCPT ); Fri, 3 Jun 2022 13:51:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26B1A5713A; Fri, 3 Jun 2022 10:48:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A90B960F4E; Fri, 3 Jun 2022 17:48:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B257FC385A9; Fri, 3 Jun 2022 17:48:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654278526; bh=Lht8QSy6hA4TSjRiwmuGl45bCsuNlAPJMnkNYDOgl4Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SwYyg7s9S9Kfs5oLQvNc+RPngBKYkNXqdz4iOBRi51f5b/dV8rIsrXcM66j5Hlqk2 eGf5ZYBHXyDVhRmPvJLzXM5v7UTftVxZN4q2tz3fjxeJ1kHvJUUvyk35Y8wibw0Ilk dbHKq1gxqDG+bZ/qpWNSyiKM3/G+oQ/66W0I6Dps= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, zlang@redhat.com, "Darrick J. Wong" , Dave Chinner , Amir Goldstein Subject: [PATCH 5.10 18/53] xfs: fix the forward progress assertion in xfs_iwalk_run_callbacks Date: Fri, 3 Jun 2022 19:43:03 +0200 Message-Id: <20220603173819.252657254@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603173818.716010877@linuxfoundation.org> References: <20220603173818.716010877@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Darrick J. Wong" commit a5336d6bb2d02d0e9d4d3c8be04b80b8b68d56c8 upstream. 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 Reviewed-by: Zorro Lang Reviewed-by: Dave Chinner Signed-off-by: Amir Goldstein Signed-off-by: Greg Kroah-Hartman --- fs/xfs/xfs_iwalk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- 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)