diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 62efbf1b2b62..7ceb6e30fc8c 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -3511,7 +3511,8 @@ static int f2fs_release_compress_blocks(struct file *filp, unsigned long arg) inode_lock(inode); writecount = atomic_read(&inode->i_writecount); - if ((filp->f_mode & FMODE_WRITE && writecount != 1) || writecount) { + if ((filp->f_mode & FMODE_WRITE && writecount != 1) || + (!(filp->f_mode & FMODE_WRITE) && writecount)) { ret = -EBUSY; goto out; }