From: Chao Yu Date: Mon, 13 Nov 2017 09:32:39 +0000 (+0800) Subject: f2fs: fix to clear FI_NO_PREALLOC X-Git-Tag: v4.14.6~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a76d81af17ceadd8bae46da297d8e24dd8ea0838;p=platform%2Fkernel%2Flinux-rpi.git f2fs: fix to clear FI_NO_PREALLOC [ Upstream commit 28cfafb73853f0494b06649716687a3ea07681d5 ] 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 Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 6ce4678..b837209 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -2697,6 +2697,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; }