]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
f2fs: fix m_may_create to make OPU DIO write correctly
authorJia Zhu <zhujia13@huawei.com>
Mon, 19 Nov 2018 20:29:35 +0000 (04:29 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 27 Nov 2018 03:46:21 +0000 (19:46 -0800)
commitf4f0b6777db4e7a4ba4f713d1d68f8e8f0ef421a
tree0c1d926d8a12e774224e7f9b8b9bb3210cd6b032
parent73c0a9272a7d2942bcae29d4829bf63277cc57c8
f2fs: fix m_may_create to make OPU DIO write correctly

Previously, we added a parameter @map.m_may_create to trigger OPU
allocation and call f2fs_balance_fs() correctly.

But in get_more_blocks(), @create has been overwritten by below code.
So the function f2fs_map_blocks() will not allocate new block address
but directly go out. Meanwile,there are several functions calling
f2fs_map_blocks() directly and @map.m_may_create not initialized.
CODE:
create = dio->op == REQ_OP_WRITE;
if (dio->flags & DIO_SKIP_HOLES) {
if (fs_startblk <= ((i_size_read(dio->inode) - 1) >>
i_blkbits))
create = 0;
}

This patch fixes it.

Signed-off-by: Jia Zhu <zhujia13@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c
fs/f2fs/file.c