All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ksmbd: use F_SETLK to force vfs_file_lock() to return asynchronously
@ 2021-12-19  9:34 Vasily Averin
  2021-12-21 12:02 ` Namjae Jeon
  0 siblings, 1 reply; 13+ messages in thread
From: Vasily Averin @ 2021-12-19  9:34 UTC (permalink / raw)
  To: Namjae Jeon, Sergey Senozhatsky, Steve French, Hyunchul Lee
  Cc: kernel, linux-cifs, linux-kernel

To avoid possible deadlock ksmbd should process locks asynchronously.
Callers expecting vfs_file_locks() to return asynchronously should only
use F_SETLK, not F_SETLKW.

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
 fs/ksmbd/smb2pdu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ksmbd/smb2pdu.c b/fs/ksmbd/smb2pdu.c
index 0c020deb76bb..34f333549767 100644
--- a/fs/ksmbd/smb2pdu.c
+++ b/fs/ksmbd/smb2pdu.c
@@ -6646,13 +6646,13 @@ static int smb2_set_flock_flags(struct file_lock *flock, int flags)
 	switch (flags) {
 	case SMB2_LOCKFLAG_SHARED:
 		ksmbd_debug(SMB, "received shared request\n");
-		cmd = F_SETLKW;
+		cmd = F_SETLK;
 		flock->fl_type = F_RDLCK;
 		flock->fl_flags |= FL_SLEEP;
 		break;
 	case SMB2_LOCKFLAG_EXCLUSIVE:
 		ksmbd_debug(SMB, "received exclusive request\n");
-		cmd = F_SETLKW;
+		cmd = F_SETLK;
 		flock->fl_type = F_WRLCK;
 		flock->fl_flags |= FL_SLEEP;
 		break;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-12-27  7:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-19  9:34 [PATCH] ksmbd: use F_SETLK to force vfs_file_lock() to return asynchronously Vasily Averin
2021-12-21 12:02 ` Namjae Jeon
2021-12-21 13:08   ` Vasily Averin
2021-12-22  2:50     ` Namjae Jeon
2021-12-22  4:32       ` Vasily Averin
2021-12-22  5:25         ` Namjae Jeon
2021-12-22  6:51           ` Vasily Averin
2021-12-22  7:40             ` Vasily Averin
2021-12-22  8:58             ` Namjae Jeon
2021-12-22 15:17               ` Vasily Averin
2021-12-24 12:31                 ` Vasily Averin
2021-12-24 23:08                   ` Namjae Jeon
2021-12-27  7:08                     ` Vasily Averin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.