diff options
| author | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-02-27 11:57:11 -0800 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-04-13 12:35:07 +0200 |
| commit | a83c1478bde55d7b24ecee84f99e702ef30add94 (patch) | |
| tree | c15c627e6934e809716a9b6fb2199e863f2b0b5e /fs | |
| parent | fac6de06309be1f92eca6b6dc96b08f243567f3d (diff) | |
f2fs: avoid to issue redundant discard commands
If segs_per_sec is over 1 like under SMR, previously f2fs issues discard
commands redundantly on the same section, since we didn't move end position
for the previous discard command.
E.g.,
start end
| |
prefree_bitmap = [01111100111100]
And, after issue discard for this section,
end start
| |
prefree_bitmap = [01111100111100]
Select this section again by searching from (end + 1),
start end
| |
prefree_bitmap = [01111100111100]
Fixes: 36abef4e796d38 ("f2fs: introduce mode=lfs mount option")
Cc: <stable@vger.kernel.org>
Cc: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/f2fs/segment.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index be93c9674..dd8eaedb2 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1175,6 +1175,8 @@ next: start = start_segno + sbi->segs_per_sec; if (start < end) goto next; + else + end = start - 1; } mutex_unlock(&dirty_i->seglist_lock); |
