f2fs: flush cp pack except cp pack 2 page at first
authorGao Xiang <hsiangkao@aol.com>
Sat, 10 Feb 2018 04:12:51 +0000 (12:12 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 12 Mar 2018 23:05:43 +0000 (08:05 +0900)
commit46706d5917f4457a6befe7a39a15c89dbb1ce9ca
tree2722d93f7bb3c6547102a3e8d8e1956176233213
parentccd31cb28ff2113a2de96ebf19a02b3c920b9fd1
f2fs: flush cp pack except cp pack 2 page at first

Previously, we attempt to flush the whole cp pack in a single bio,
however, when suddenly powering off at this time, we could get into
an extreme scenario that cp pack 1 page and cp pack 2 page are updated
and latest, but payload or current summaries are still partially
outdated. (see reliable write in the UFS specification)

This patch submits the whole cp pack except cp pack 2 page at first,
and then writes the cp pack 2 page with an extra independent
bio with pre-io barrier.

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