diff options
author | Chao Yu <yuchao0@huawei.com> | 2017-11-13 12:32:39 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-12-14 11:53:14 +0300 |
commit | a76d81af17ceadd8bae46da297d8e24dd8ea0838 (patch) | |
tree | ca4ffa6b9ab814aa9783a14c9c9bc015be2efb93 /fs/f2fs | |
parent | 6610b9cb80ad9a58f71940b9658e3116262663db (diff) | |
download | linux-a76d81af17ceadd8bae46da297d8e24dd8ea0838.tar.xz |
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 <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/file.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 6ce467872376..b8372095ba0a 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; } |