ext4: simplify some code in read_mmp_block()
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 15 Aug 2015 15:30:31 +0000 (11:30 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 15 Aug 2015 15:30:31 +0000 (11:30 -0400)
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.

[ Restructured the code so that we print a warning message as well if
  the mmp block doesn't check out, and to print the error code to
  disambiguate between the error cases.  - TYT ]

Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/mmp.c

diff --cc fs/ext4/mmp.c
Simple merge