OSDN Git Service

f2fs: fix to migrate blocks correctly during defragment
authorChao Yu <yuchao0@huawei.com>
Mon, 29 Jul 2019 15:02:29 +0000 (23:02 +0800)
committer0ranko0P <ranko0p@outlook.com>
Tue, 24 Dec 2019 20:42:23 +0000 (04:42 +0800)
commit9742e04922f0b640697c478c02a3531845d6b6d2
tree92ff2f840a4512cec277d6b701174b4d9b7f0664
parentb558bf175e14c216a7ca21d93c857c1810cbe12a
f2fs: fix to migrate blocks correctly during defragment

During defragment, we missed to trigger fragmented blocks migration
for below condition:

In defragment region:
- total number of valid blocks is smaller than 512;
- the tail part of the region are all holes;

In addtion, return zero to user via range->len if there is no
fragmented blocks.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/file.c