mirror of https://gitee.com/openkylin/linux.git
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 <daehojeong@google.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
af4b6b8edf
commit
8c8cf26ae3
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue