f2fs: fix to release discard entries during checkpoint
authorChao Yu <yuchao0@huawei.com>
Tue, 11 Oct 2016 14:57:00 +0000 (22:57 +0800)
committerJaegeuk Kim <jaegeuk@google.com>
Mon, 25 Sep 2017 22:04:47 +0000 (15:04 -0700)
commitab38818bdd9a67f9ce6aade05f61e373d45ae132
tree3b66f4f9516cd9ade9b738683f3aecb55c33593e
parent311aa690ef7bd32732a65d957c2490143c7b9830
f2fs: fix to release discard entries during checkpoint

commit 2dd15654ac0abe587a245a09a7823bbbd588bfb7 upstream.

In f2fs_fill_super, if there is any IO error occurs during recovery,
cached discard entries will be leaked, in order to avoid this, make
write_checkpoint() handle memory release by itself, besides, move
clear_prefree_segments to write_checkpoint for readability.

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