f2fs: do not set free of current section
authorYunlong Song <yunlong.song@huawei.com>
Thu, 12 Jul 2018 15:09:26 +0000 (23:09 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 5 Sep 2018 22:11:39 +0000 (15:11 -0700)
commit390638608a5bcd0b503094474812bc374a9f355f
tree6f862eb6d8b823230e0f43b80ba8c8295512fe13
parentef2544b77113d63f796a37d8b26cc2379e23a608
f2fs: do not set free of current section

For the case when sbi->segs_per_sec > 1, take section:segment = 5 for
example, if segment 1 is just used and allocate new segment 2, and the
blocks of segment 1 is invalidated, at this time, the previous code will
use __set_test_and_free to free the free_secmap and free_sections++,
this is not correct since it is still a current section, so fix it.

Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/segment.h