ext4: return ENOMEM if sb_getblk() fails
authorTheodore Ts'o <tytso@mit.edu>
Sat, 12 Jan 2013 21:19:36 +0000 (16:19 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Mar 2014 23:10:06 +0000 (16:10 -0700)
commitc28414d3497a0db41a9fb08650131ee15989ee9c
treeee7207a07f766bf45670c466ee2640a17d78e289
parent0ef4c881e4ade7a45174d9cf45eca6f9e10f5ccc
ext4: return ENOMEM if sb_getblk() fails

commit 860d21e2c585f7ee8a4ecc06f474fdc33c9474f4 upstream.

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>
[xr: Backported to 3.4:
 - Drop change to inline.c
 - Call to ext4_ext_check() from ext4_ext_find_extent() is conditional]
Signed-off-by: Rui Xiang <rui.xiang@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/extents.c
fs/ext4/indirect.c
fs/ext4/inode.c
fs/ext4/mmp.c
fs/ext4/resize.c
fs/ext4/xattr.c