diff mbox series

[5/5] xfs_repair: fix messaging when fixing imap due to sparse cluster

Message ID 168597948159.1226461.18433540672354330389.stgit@frogsfrogsfrogs (mailing list archive)
State Accepted
Headers show
Series xfs_repair: fix corruption messaging with verbose mode | expand

Commit Message

Darrick J. Wong June 5, 2023, 3:38 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

This logic is wrong -- if we're in verbose dry-run mode, we do NOT want
to say that we're correcting the imap.  Otherwise, we print things like:

imap claims inode XXX is present, but inode cluster is sparse,

But then we can erroneously tell the user that we would correct the
imap when in fact we /are/ correcting it.

Fixes: f4ff8086586 ("xfs_repair: don't crash on partially sparse inode clusters")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 repair/dino_chunks.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Carlos Maiolino June 6, 2023, 11 a.m. UTC | #1
On Mon, Jun 05, 2023 at 08:38:01AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> This logic is wrong -- if we're in verbose dry-run mode, we do NOT want
> to say that we're correcting the imap.  Otherwise, we print things like:
> 
> imap claims inode XXX is present, but inode cluster is sparse,
> 
> But then we can erroneously tell the user that we would correct the
> imap when in fact we /are/ correcting it.
> 
> Fixes: f4ff8086586 ("xfs_repair: don't crash on partially sparse inode clusters")
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>

Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>

> ---
>  repair/dino_chunks.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 
> diff --git a/repair/dino_chunks.c b/repair/dino_chunks.c
> index 33008853789..171756818a6 100644
> --- a/repair/dino_chunks.c
> +++ b/repair/dino_chunks.c
> @@ -834,7 +834,7 @@ process_inode_chunk(
>  			do_warn(
>  	_("imap claims inode %" PRIu64 " is present, but inode cluster is sparse, "),
>  						ino);
> -			if (verbose || !no_modify)
> +			if (!no_modify)
>  				do_warn(_("correcting imap\n"));
>  			else
>  				do_warn(_("would correct imap\n"));
>
diff mbox series

Patch

diff --git a/repair/dino_chunks.c b/repair/dino_chunks.c
index 33008853789..171756818a6 100644
--- a/repair/dino_chunks.c
+++ b/repair/dino_chunks.c
@@ -834,7 +834,7 @@  process_inode_chunk(
 			do_warn(
 	_("imap claims inode %" PRIu64 " is present, but inode cluster is sparse, "),
 						ino);
-			if (verbose || !no_modify)
+			if (!no_modify)
 				do_warn(_("correcting imap\n"));
 			else
 				do_warn(_("would correct imap\n"));