diff options
author | Chao Yu <yuchao0@huawei.com> | 2020-07-03 10:40:11 +0200 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2020-07-08 19:11:19 +0200 |
commit | f567adb0342e125903cbe77adcf1e09b53acda1f (patch) | |
tree | ab26a1aa00a914390e32dae836753f62c0fa67d9 /fs/f2fs | |
parent | f2fs: remove write attribute of main_blkaddr sysfs node (diff) | |
download | linux-f567adb0342e125903cbe77adcf1e09b53acda1f.tar.xz linux-f567adb0342e125903cbe77adcf1e09b53acda1f.zip |
f2fs: fix to wait GCed compressed page writeback
like we did for encrypted page.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/compress.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index b3ecf7d4d6d8..3a847bc36748 100644 --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -1152,6 +1152,13 @@ static int f2fs_write_compressed_pages(struct compress_ctx *cc, f2fs_set_compressed_page(cc->cpages[i], inode, cc->rpages[i + 1]->index, cic); fio.compressed_page = cc->cpages[i]; + + fio.old_blkaddr = data_blkaddr(dn.inode, dn.node_page, + dn.ofs_in_node + i + 1); + + /* wait for GCed page writeback via META_MAPPING */ + f2fs_wait_on_block_writeback(inode, fio.old_blkaddr); + if (fio.encrypted) { fio.page = cc->rpages[i + 1]; err = f2fs_encrypt_one_page(&fio); |