Commit 28cfafb7 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim

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: dc91de78 ("f2fs: do not preallocate blocks which has wrong buffer")
Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 2c8a4a28
...@@ -2750,6 +2750,7 @@ static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from) ...@@ -2750,6 +2750,7 @@ static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
err = f2fs_preallocate_blocks(iocb, from); err = f2fs_preallocate_blocks(iocb, from);
if (err) { if (err) {
clear_inode_flag(inode, FI_NO_PREALLOC);
inode_unlock(inode); inode_unlock(inode);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment