diff options
author | Theodore Ts'o <tytso@mit.edu> | 2013-01-12 16:19:36 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2013-01-12 16:19:36 -0500 |
commit | 860d21e2c585f7ee8a4ecc06f474fdc33c9474f4 (patch) | |
tree | f4b8f664599f043b7aa7b86a9a135aa275f0a5e2 /fs/ext4/mmp.c | |
parent | 9931faca02c604c22335f5a935a501bb2ace6e20 (diff) |
ext4: return ENOMEM if sb_getblk() fails
The only reason for sb_getblk() failing is if it can't allocate the
buffer_head. So ENOMEM is more appropriate than EIO. In addition,
make sure that the file system is marked as being inconsistent if
sb_getblk() fails.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@vger.kernel.org
Diffstat (limited to 'fs/ext4/mmp.c')
-rw-r--r-- | fs/ext4/mmp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c index fe7c63f4717e..44734f1ca554 100644 --- a/fs/ext4/mmp.c +++ b/fs/ext4/mmp.c | |||
@@ -80,6 +80,8 @@ static int read_mmp_block(struct super_block *sb, struct buffer_head **bh, | |||
80 | * is not blocked in the elevator. */ | 80 | * is not blocked in the elevator. */ |
81 | if (!*bh) | 81 | if (!*bh) |
82 | *bh = sb_getblk(sb, mmp_block); | 82 | *bh = sb_getblk(sb, mmp_block); |
83 | if (!*bh) | ||
84 | return -ENOMEM; | ||
83 | if (*bh) { | 85 | if (*bh) { |
84 | get_bh(*bh); | 86 | get_bh(*bh); |
85 | lock_buffer(*bh); | 87 | lock_buffer(*bh); |