]> git.karo-electronics.de Git - linux-beck.git/commit
ext4: return error code from ext4_mb_good_group()
authorLukas Czerner <lczerner@redhat.com>
Mon, 8 Jun 2015 15:40:40 +0000 (11:40 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 8 Jun 2015 15:40:40 +0000 (11:40 -0400)
commit42ac1848eac58875ceb081c2ed915d6f07ec1f30
tree6d6e4eb5d148907fd08bd605c0021820720cd737
parentbbdc322f2c600667e3d23dfadf8bbaad08f7edd3
ext4: return error code from ext4_mb_good_group()

Currently ext4_mb_good_group() only returns 0 or 1 depending on whether
the allocation group is suitable for use or not. However we might get
various errors and fail while initializing new group including -EIO
which would never get propagated up the call chain. This might lead to
an endless loop at writeback when we're trying to find a good group to
allocate from and we fail to initialize new group (read error for
example).

Fix this by returning proper error code from ext4_mb_good_group() and
using it in ext4_mb_regular_allocator(). In ext4_mb_regular_allocator()
we will always return only the first occurred error from
ext4_mb_good_group() and we only propagate it back  to the caller if we
do not get any other errors and we fail to allocate any blocks.

Note that with other modes than errors=continue, we will fail
immediately in ext4_mb_good_group() in case of error, however with
errors=continue we should try to continue using the file system, that's
why we're not going to fail immediately when we see an error from
ext4_mb_good_group(), but rather when we fail to find a suitable block
group to allocate from due to an problem in group initialization.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/ext4/mballoc.c