mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
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>
This commit is contained in:
parent
60e4cf67a5
commit
30ef0e4085
1 changed files with 0 additions and 1 deletions
|
@ -736,7 +736,6 @@ ext2_try_to_allocate(struct super_block *sb, int group,
|
||||||
*count = num;
|
*count = num;
|
||||||
return grp_goal - num;
|
return grp_goal - num;
|
||||||
fail_access:
|
fail_access:
|
||||||
*count = num;
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue