ext2: don't set *count in the case of failure in ext2_try_to_allocate()
authorChengguang Xu <cgxu519@mykernel.net>
Sat, 26 Oct 2019 09:07:21 +0000 (17:07 +0800)
committerJan Kara <jack@suse.cz>
Thu, 31 Oct 2019 14:40:44 +0000 (15:40 +0100)
commit30ef0e4085070312101be26c015f36277f02e12b
tree2d7cd78e1e0709fbd1db234a1df8b699b2bc912f
parent60e4cf67a582d64f07713eda5fcc8ccdaf7833e6
ext2: don't set *count in the case of failure in ext2_try_to_allocate()

Currently we set *count to num(value 0) in the failure
of block allocation in ext2_try_to_allocate(). Without
reservation, we reuse *count(value 0) to retry block
allocation and wrong *count will cause only allocating
maximum 1 block even though having sufficent free blocks
in that block group. Finally, it probably cause significant
fragmentation.

Link: https://lore.kernel.org/r/20191026090721.23794-1-cgxu519@mykernel.net
Signed-off-by: Chengguang Xu <cgxu519@mykernel.net>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/ext2/balloc.c