]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
f2fs: fix to clear FI_NO_PREALLOC
authorChao Yu <yuchao0@huawei.com>
Mon, 13 Nov 2017 09:32:39 +0000 (17:32 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 14 Nov 2017 04:21:22 +0000 (20:21 -0800)
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>
fs/f2fs/file.c

index 8742c028acc69ca560bc3176bc3e7700389891ef..41a6f1f704167fdb333894144ec2e4454c868cb7 100644 (file)
@@ -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;
                }