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>
Sun, 8 Apr 2018 11:11:18 +0000 (04:11 -0700)
commit755dcc3262d42158ee546adcfbcb61175462251b
tree302275b9e312e3de50cd7d606401ed91366a9664
parent92223ccb699a9ea815ace3eb701515fc101631f5
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