mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
fuse: set ff->flock only on success
If FUSE_SETLK fails (e.g., due to EWOULDBLOCK), we shall not set FUSE_RELEASE_FLOCK_UNLOCK in fuse_file_release(). Reported-by: Li Yichao <liyichao.1@bytedance.com> Signed-off-by: Zhang Tianci <zhangtianci.1997@bytedance.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
This commit is contained in:
parent
ac7304fa1d
commit
71947173ce
|
|
@ -2569,8 +2569,9 @@ static int fuse_file_flock(struct file *file, int cmd, struct file_lock *fl)
|
|||
struct fuse_file *ff = file->private_data;
|
||||
|
||||
/* emulate flock with POSIX locks */
|
||||
ff->flock = true;
|
||||
err = fuse_setlk(file, fl, 1);
|
||||
if (!err)
|
||||
ff->flock = true;
|
||||
}
|
||||
|
||||
return err;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user