OSDN Git Service

f2fs: fix redundant block allocation
authorJaegeuk Kim <jaegeuk@kernel.org>
Sat, 12 Nov 2016 00:46:40 +0000 (16:46 -0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 25 Nov 2016 18:15:50 +0000 (10:15 -0800)
commitc040ff9d69fd1d782fe577ba9e35c1f5798158ae
treeb833c477d306b768d88be6203a4cf0ecc55dbb61
parenta7de608691f766cd148971a71d4f13aa1692d4c8
f2fs: fix redundant block allocation

In direct_IO path of f2fs_file_write_iter(),
1. f2fs_preallocate_blocks(F2FS_GET_BLOCK_PRE_DIO)
   -> allocate LBA X
2. f2fs_direct_IO()
   -> return 0;

Then,
f2fs_write_data_page() will allocate another LBA X+1.

This makes EIO triggered by HM-SMR.

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