kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Andreas Dilger <adilger@dilger.ca>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	Ext4 Developers List <linux-ext4@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch 1/2 v2] ext4: simplify some code in read_mmp_block()
Date: Sat, 15 Aug 2015 15:37:13 +0000	[thread overview]
Message-ID: <20150815153713.GB22485@thunk.org> (raw)
In-Reply-To: <6D4783E5-BFDB-42E0-800A-DFD18B3E7A64@dilger.ca>

On Fri, Aug 14, 2015 at 11:03:46AM -0600, Andreas Dilger wrote:
> > My static check complains because we have:
> > 
> > 	if (!*bh)
> > 		return -ENOMEM;
> > 	if (*bh) {
> > 
> > The second check is unnecessary.
> > 
> > I've simplified this code by moving the "if (!*bh)" checks around.  Also
> > Andreas Dilger says we should probably print a warning if sb_getblk()
> > fails.
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> Reviewed-by: Andreas Dilger <adilger@dilger.ca>

Applied, thanks.  I've changed the patch slightly to also print a
warning if the MMP magic number and/or checksum for the MMP block
doesn't check out, and to print the error code to disambiguate between
the various failure cases.

One thing, from looking at the function --- it looks like it might be
a good idea if we were to move the call to clear_buffer_uptodate() to
*after* the sb_getblk() call, no?

Otherwise we don't reread the MMP block if it is already in the cache,
and it is the first time read_mmp_block() is called in a function in
fs/ext4/mmp.c.....

							- Ted

  reply	other threads:[~2015-08-15 15:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-10 21:34 [patch] ext4: simplify some code in read_mmp_block() Dan Carpenter
2015-08-10 23:07 ` Andreas Dilger
2015-08-14  9:47   ` [patch 1/2 v2] " Dan Carpenter
2015-08-14 17:03     ` Andreas Dilger
2015-08-15 15:37       ` Theodore Ts'o [this message]
2015-08-17 16:47         ` Andreas Dilger
2015-08-14  9:47   ` [patch 2/2] ext4: silence a format string false positive Dan Carpenter
2015-08-15 15:40     ` Theodore Ts'o

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=20150815153713.GB22485@thunk.org \
    --to=tytso@mit.edu \
    --cc=adilger@dilger.ca \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    /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 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).