summaryrefslogtreecommitdiff
path: root/fs/f2fs
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2017-11-13 17:32:39 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2017-11-13 20:21:22 -0800
commit28cfafb73853f0494b06649716687a3ea07681d5 (patch)
treeb730ee700589a2a0cd01872c627ac68a3fbd25d6 /fs/f2fs
parent2c8a4a28233482ad697db92d86da10fcb498eaf7 (diff)
f2fs: fix to clear FI_NO_PREALLOC
We need to clear FI_NO_PREALLOC flag in error path of f2fs_file_write_iter, otherwise we will lose the chance to preallocate blocks in latter write() at one time. Fixes: dc91de78e5e1 ("f2fs: do not preallocate blocks which has wrong buffer") Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/file.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 8742c028acc6..41a6f1f70416 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -2750,6 +2750,7 @@ static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
err = f2fs_preallocate_blocks(iocb, from);
if (err) {
+ clear_inode_flag(inode, FI_NO_PREALLOC);
inode_unlock(inode);
return err;
}