ath25: drop target
[openwrt/staging/pepe2k.git] / target / linux / generic / pending-5.15 / 540-ksmbd-only-v2-leases-handle-the-directory.patch
1 From cb1d41b99e4afa062f904339666fae2578559718 Mon Sep 17 00:00:00 2001
2 From: Namjae Jeon <linkinjeon@kernel.org>
3 Date: Mon, 15 Jan 2024 10:24:54 +0900
4 Subject: [PATCH] ksmbd: only v2 leases handle the directory
5
6 When smb2 leases is disable, ksmbd can send oplock break notification
7 and cause wait oplock break ack timeout. It may appear like hang when
8 accessing a directory. This patch make only v2 leases handle the
9 directory.
10
11 Cc: stable@vger.kernel.org
12 Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
13 Signed-off-by: Steve French <stfrench@microsoft.com>
14 ---
15 fs/ksmbd/oplock.c | 6 ++++++
16 1 file changed, 6 insertions(+)
17
18 --- a/fs/ksmbd/oplock.c
19 +++ b/fs/ksmbd/oplock.c
20 @@ -1191,6 +1191,12 @@ int smb_grant_oplock(struct ksmbd_work *
21 bool prev_op_has_lease;
22 __le32 prev_op_state = 0;
23
24 + /* Only v2 leases handle the directory */
25 + if (S_ISDIR(file_inode(fp->filp)->i_mode)) {
26 + if (!lctx || lctx->version != 2)
27 + return 0;
28 + }
29 +
30 opinfo = alloc_opinfo(work, pid, tid);
31 if (!opinfo)
32 return -ENOMEM;