* [PATCH] ext4: don't print warnings on successful MMP read completion
@ 2015-09-30 17:42 Darrick J. Wong
2015-10-01 6:20 ` Andreas Dilger
0 siblings, 1 reply; 3+ messages in thread
From: Darrick J. Wong @ 2015-09-30 17:42 UTC (permalink / raw)
To: Theodore Ts'o; +Cc: linux-ext4
If the MMP block reads without error, don't spam dmesg with warnings.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
fs/ext4/mmp.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c
index 6eb1a61..7bc0873 100644
--- a/fs/ext4/mmp.c
+++ b/fs/ext4/mmp.c
@@ -104,8 +104,9 @@ static int read_mmp_block(struct super_block *sb, struct buffer_head **bh,
ret = -EINVAL;
warn_exit:
- ext4_warning(sb, "Error %d while reading MMP block %llu",
- ret, mmp_block);
+ if (ret)
+ ext4_warning(sb, "Error %d while reading MMP block %llu",
+ ret, mmp_block);
return ret;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ext4: don't print warnings on successful MMP read completion
2015-09-30 17:42 [PATCH] ext4: don't print warnings on successful MMP read completion Darrick J. Wong
@ 2015-10-01 6:20 ` Andreas Dilger
2015-10-01 6:26 ` Darrick J. Wong
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Dilger @ 2015-10-01 6:20 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: Theodore Ts'o, linux-ext4
On Sep 30, 2015, at 11:42 AM, Darrick J. Wong <darrick.wong@oracle.com> wrote:
>
> If the MMP block reads without error, don't spam dmesg with warnings.
It is hard to tell from the patch context here, but in the version
of read_mmp_block() I have (v4.3-rc3-55-gdd36d73) the only way to
get to warn_exit: is if there is an error already.
> diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c
> index 6eb1a61..7bc0873 100644
> --- a/fs/ext4/mmp.c
> +++ b/fs/ext4/mmp.c
> @@ -104,8 +104,9 @@ static int read_mmp_block(struct super_block *sb, struct buffer_head **bh,
The preceding few lines are as follows, and all of the jumps to
warn_exit before this set ret != 0:
mmp = (struct mmp_struct *)((*bh)->b_data);
if (le32_to_cpu(mmp->mmp_magic) == EXT4_MMP_MAGIC &&
ext4_mmp_csum_verify(sb, mmp))
return 0;
> ret = -EINVAL;
>
> warn_exit:
> - ext4_warning(sb, "Error %d while reading MMP block %llu",
> - ret, mmp_block);
> + if (ret)
> + ext4_warning(sb, "Error %d while reading MMP block %llu",
> + ret, mmp_block);
> return ret;
> }
How does this code get to warn_exit: without setting ret?
Cheers, Andreas
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ext4: don't print warnings on successful MMP read completion
2015-10-01 6:20 ` Andreas Dilger
@ 2015-10-01 6:26 ` Darrick J. Wong
0 siblings, 0 replies; 3+ messages in thread
From: Darrick J. Wong @ 2015-10-01 6:26 UTC (permalink / raw)
To: Andreas Dilger; +Cc: Theodore Ts'o, linux-ext4
On Thu, Oct 01, 2015 at 12:20:43AM -0600, Andreas Dilger wrote:
> On Sep 30, 2015, at 11:42 AM, Darrick J. Wong <darrick.wong@oracle.com> wrote:
> >
> > If the MMP block reads without error, don't spam dmesg with warnings.
>
> It is hard to tell from the patch context here, but in the version
> of read_mmp_block() I have (v4.3-rc3-55-gdd36d73) the only way to
> get to warn_exit: is if there is an error already.
Aha! I'd forgotten that this patch came after an (unreleased) patch to change
all the checksum and corruption errors to report the same codes as XFS.
Without /that/ patch, this one is unnecessary.
Sorry for the noise, everyone can disregard this (for now).
--D
>
> > diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c
> > index 6eb1a61..7bc0873 100644
> > --- a/fs/ext4/mmp.c
> > +++ b/fs/ext4/mmp.c
> > @@ -104,8 +104,9 @@ static int read_mmp_block(struct super_block *sb, struct buffer_head **bh,
>
> The preceding few lines are as follows, and all of the jumps to
> warn_exit before this set ret != 0:
>
> mmp = (struct mmp_struct *)((*bh)->b_data);
> if (le32_to_cpu(mmp->mmp_magic) == EXT4_MMP_MAGIC &&
> ext4_mmp_csum_verify(sb, mmp))
> return 0;
> > ret = -EINVAL;
> >
> > warn_exit:
> > - ext4_warning(sb, "Error %d while reading MMP block %llu",
> > - ret, mmp_block);
> > + if (ret)
> > + ext4_warning(sb, "Error %d while reading MMP block %llu",
> > + ret, mmp_block);
> > return ret;
> > }
>
> How does this code get to warn_exit: without setting ret?
>
> Cheers, Andreas
>
>
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-10-01 6:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-30 17:42 [PATCH] ext4: don't print warnings on successful MMP read completion Darrick J. Wong
2015-10-01 6:20 ` Andreas Dilger
2015-10-01 6:26 ` Darrick J. Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).