diff options
author | Jia Zhu <zhujia13@huawei.com> | 2018-11-27 02:32:32 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2018-11-26 16:42:03 -0800 |
commit | 73c0a9272a7d2942bcae29d4829bf63277cc57c8 (patch) | |
tree | 74dd7c05ee09426f69e5aeab4ce83165e7472ed0 /fs/f2fs | |
parent | e3c59108da8655de78fe59843372b8cfab1a8e33 (diff) | |
download | linux-73c0a9272a7d2942bcae29d4829bf63277cc57c8.tar.gz linux-73c0a9272a7d2942bcae29d4829bf63277cc57c8.tar.bz2 linux-73c0a9272a7d2942bcae29d4829bf63277cc57c8.zip |
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: <stable@vger.kernel.org>
Fixes: 511f52d02f05 ("f2fs: allow out-place-update for direct IO in LFS mode")
Signed-off-by: Jia Zhu <zhujia13@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/data.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 8780f3d737c4..3b7ccb31ad30 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1089,8 +1089,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) { |