• Jia Zhu's avatar
    f2fs: fix m_may_create to make OPU DIO write correctly · f4f0b677
    Jia Zhu authored
    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: default avatarJia Zhu <zhujia13@huawei.com>
    Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
    Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
    f4f0b677
file.c 73.9 KB