f2fs: fix writecount false positive in releasing compress blocks
PATCH 1/1 f2fs: fix writecount false positive in releasing compress blocks
From: Daeho Jeong <[email protected]>
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]>
--- fs/f2fs/file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/file.c +2 -1
@@ -3509,7 +3509,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; }
Signature · 1 line
2.28.0.1011.ga647a8990f-goog
Quoted 6 lines · Daeho Jeong
From: Daeho Jeong <[email protected]>
In current condition check, if it detects writecount, it return
-EBUSYregardless off_modeof the file. Fixed it.Signed-off-by Daeho Jeong <[email protected]>
Reviewed-by Chao Yu <[email protected]>
Thanks,