Skip to content

Commit 77bebd1

Browse files
namjaejeonSteve French
authored and
Steve French
committed
ksmbd: only v2 leases handle the directory
When smb2 leases is disable, ksmbd can send oplock break notification and cause wait oplock break ack timeout. It may appear like hang when accessing a directory. This patch make only v2 leases handle the directory. Cc: stable@vger.kernel.org Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 38d20c6 commit 77bebd1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

fs/smb/server/oplock.c

+6
Original file line numberDiff line numberDiff line change
@@ -1197,6 +1197,12 @@ int smb_grant_oplock(struct ksmbd_work *work, int req_op_level, u64 pid,
11971197
bool prev_op_has_lease;
11981198
__le32 prev_op_state = 0;
11991199

1200+
/* Only v2 leases handle the directory */
1201+
if (S_ISDIR(file_inode(fp->filp)->i_mode)) {
1202+
if (!lctx || lctx->version != 2)
1203+
return 0;
1204+
}
1205+
12001206
opinfo = alloc_opinfo(work, pid, tid);
12011207
if (!opinfo)
12021208
return -ENOMEM;

0 commit comments

Comments
 (0)