All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Dave Chinner <david@fromorbit.com>,
	"Darrick J . Wong" <darrick.wong@oracle.com>
Cc: Luis Chamberlain <mcgrof@kernel.org>,
	Theodore Ts'o <tytso@mit.edu>,
	Adam Manzanares <a.manzanares@samsung.com>,
	Tyler Hicks <code@tyhicks.com>,
	linux-xfs@vger.kernel.org, fstests@vger.kernel.org,
	zlang@redhat.com, Dave Chinner <dchinner@redhat.com>
Subject: [PATH 5.10 3/4] xfs: fix the forward progress assertion in xfs_iwalk_run_callbacks
Date: Wed, 25 May 2022 14:17:14 +0300	[thread overview]
Message-ID: <20220525111715.2769700-4-amir73il@gmail.com> (raw)
In-Reply-To: <20220525111715.2769700-1-amir73il@gmail.com>

From: "Darrick J. Wong" <darrick.wong@oracle.com>

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 <darrick.wong@oracle.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
 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)
-- 
2.25.1


  parent reply	other threads:[~2022-05-25 11:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-25 11:17 [PATH 5.10 0/4] xfs stable candidate patches for 5.10.y (part 1) Amir Goldstein
2022-05-25 11:17 ` [PATH 5.10 1/4] xfs: detect overflows in bmbt records Amir Goldstein
2022-05-25 11:17 ` [PATH 5.10 2/4] xfs: show the proper user quota options Amir Goldstein
2022-05-25 11:17 ` Amir Goldstein [this message]
2022-05-25 11:17 ` [PATH 5.10 4/4] xfs: fix an ABBA deadlock in xfs_rename Amir Goldstein
2022-05-26 17:27 ` [PATH 5.10 0/4] xfs stable candidate patches for 5.10.y (part 1) Darrick J. Wong
2022-05-26 18:44   ` Luis Chamberlain
2022-05-26 18:59     ` Amir Goldstein
2022-05-27 13:10       ` Luis Chamberlain
2022-05-26 18:47   ` Amir Goldstein
2022-05-27  6:06 ` Christoph Hellwig
2022-05-27  7:01   ` Amir Goldstein
2022-05-27  9:08     ` Dave Chinner
2022-05-27 12:24       ` Amir Goldstein
2022-05-27 15:40         ` Luis Chamberlain
2022-05-27 17:19           ` Darrick J. Wong
2022-05-27 23:42           ` Dave Chinner
2022-05-28  5:00             ` Amir Goldstein
2022-06-01  4:31               ` Dave Chinner
2022-06-01  7:10                 ` Amir Goldstein
2022-06-02  4:12                   ` Theodore Ts'o
2022-06-02  5:34                     ` Amir Goldstein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220525111715.2769700-4-amir73il@gmail.com \
    --to=amir73il@gmail.com \
    --cc=a.manzanares@samsung.com \
    --cc=code@tyhicks.com \
    --cc=darrick.wong@oracle.com \
    --cc=david@fromorbit.com \
    --cc=dchinner@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=tytso@mit.edu \
    --cc=zlang@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.