From b16b66345db666d0e98024c6b2ddd2d74d126db4 Mon Sep 17 00:00:00 2001 From: Jia Zhu Date: Tue, 27 Nov 2018 02:32:32 +0800 Subject: [PATCH] f2fs: fix to update new block address correctly for OPU Previously, we allocated a new block address for OPU mode in direct_IO. But the new address couldn't be assigned to @map->m_pblk correctly. This patch fix it. Cc: Fixes: 511f52d02f05 ("f2fs: allow out-place-update for direct IO in LFS mode") Signed-off-by: Jia Zhu Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index d2d3b6492924..22ace799bc68 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1086,8 +1086,10 @@ next_block: if (test_opt(sbi, LFS) && flag == F2FS_GET_BLOCK_DIO && map->m_may_create) { err = __allocate_data_block(&dn, map->m_seg_type); - if (!err) + if (!err) { + blkaddr = dn.data_blkaddr; set_inode_flag(inode, FI_APPEND_WRITE); + } } } else { if (create) { -- 2.11.0