diff options
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r-- | fs/f2fs/file.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 344e0bd638e5..6528216ab832 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -57,9 +57,11 @@ static vm_fault_t f2fs_vm_page_mkwrite(struct vm_fault *vmf) err = -EIO; goto err; } - err = f2fs_is_checkpoint_ready(sbi); - if (err) + + if (!f2fs_is_checkpoint_ready(sbi)) { + err = -ENOSPC; goto err; + } sb_start_pagefault(inode->i_sb); @@ -1571,9 +1573,8 @@ static long f2fs_fallocate(struct file *file, int mode, if (unlikely(f2fs_cp_error(F2FS_I_SB(inode)))) return -EIO; - ret = f2fs_is_checkpoint_ready(F2FS_I_SB(inode)); - if (ret) - return ret; + if (!f2fs_is_checkpoint_ready(F2FS_I_SB(inode))) + return -ENOSPC; /* f2fs only support ->fallocate for regular file */ if (!S_ISREG(inode->i_mode)) @@ -3146,13 +3147,10 @@ out: long f2fs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { - int ret; - if (unlikely(f2fs_cp_error(F2FS_I_SB(file_inode(filp))))) return -EIO; - ret = f2fs_is_checkpoint_ready(F2FS_I_SB(file_inode(filp))); - if (ret) - return ret; + if (!f2fs_is_checkpoint_ready(F2FS_I_SB(file_inode(filp)))) + return -ENOSPC; switch (cmd) { case F2FS_IOC_GETFLAGS: |