summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChengguang Xu <cgxu519@mykernel.net>2019-10-26 11:07:21 +0200
committerJan Kara <jack@suse.cz>2019-10-31 15:40:44 +0100
commit30ef0e4085070312101be26c015f36277f02e12b (patch)
tree2d7cd78e1e0709fbd1db234a1df8b699b2bc912f /fs
parentreiserfs: fix extended attributes on the root directory (diff)
downloadlinux-30ef0e4085070312101be26c015f36277f02e12b.tar.xz
linux-30ef0e4085070312101be26c015f36277f02e12b.zip
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext2/balloc.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c
index 4664d324567c..19bce75d207b 100644
--- a/fs/ext2/balloc.c
+++ b/fs/ext2/balloc.c
@@ -736,7 +736,6 @@ repeat:
*count = num;
return grp_goal - num;
fail_access:
- *count = num;
return -1;
}