Skip to content

Commit 8c8cf26

Browse files
Daeho JeongJaegeuk Kim
Daeho Jeong
authored and
Jaegeuk Kim
committed
f2fs: fix writecount false positive in releasing compress blocks
In current condition check, if it detects writecount, it return -EBUSY regardless of f_mode of the file. Fixed it. Signed-off-by: Daeho Jeong <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent af4b6b8 commit 8c8cf26

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/f2fs/file.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3511,7 +3511,8 @@ static int f2fs_release_compress_blocks(struct file *filp, unsigned long arg)
35113511
inode_lock(inode);
35123512

35133513
writecount = atomic_read(&inode->i_writecount);
3514-
if ((filp->f_mode & FMODE_WRITE && writecount != 1) || writecount) {
3514+
if ((filp->f_mode & FMODE_WRITE && writecount != 1) ||
3515+
(!(filp->f_mode & FMODE_WRITE) && writecount)) {
35153516
ret = -EBUSY;
35163517
goto out;
35173518
}

0 commit comments

Comments
 (0)