diff options
author | Chao Yu <chao2.yu@samsung.com> | 2015-02-28 10:23:30 +0100 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-04-11 00:08:31 +0200 |
commit | b28c3f94933dae663eeca24637bf9ff962bf02dc (patch) | |
tree | e835601539134540ca01ec2eb1412d30cd15a718 /fs/f2fs | |
parent | f2fs: add cond_resched() to sync_dirty_dir_inodes() (diff) | |
download | linux-b28c3f94933dae663eeca24637bf9ff962bf02dc.tar.xz linux-b28c3f94933dae663eeca24637bf9ff962bf02dc.zip |
f2fs: fix to issue small discard in real-time mode discard
Now in f2fs, we share functions and structures for batch mode and real-time mode
discard. For real-time mode discard, in shared function add_discard_addrs, we
will use uninitialized trim_minlen in struct cp_control to compare with length
of contiguous free blocks to decide whether skipping discard fragmented freespace
or not, this makes us ignore small discard sometimes. Fix it.
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Reviewed-by : Changman Lee <cm224.lee@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/segment.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 1e909340842a..3e80bd69d4a0 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -552,7 +552,7 @@ static void add_discard_addrs(struct f2fs_sb_info *sbi, struct cp_control *cpc) end = __find_rev_next_zero_bit(dmap, max_blocks, start + 1); - if (end - start < cpc->trim_minlen) + if (force && end - start < cpc->trim_minlen) continue; __add_discard_entry(sbi, cpc, start, end); |