mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-17 16:14:25 +08:00
ksmbd: only v2 leases handle the directory
commit 77bebd1864
upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
24290ba94c
commit
08e6c82300
@ -1191,6 +1191,12 @@ int smb_grant_oplock(struct ksmbd_work *work, int req_op_level, u64 pid,
|
||||
bool prev_op_has_lease;
|
||||
__le32 prev_op_state = 0;
|
||||
|
||||
/* Only v2 leases handle the directory */
|
||||
if (S_ISDIR(file_inode(fp->filp)->i_mode)) {
|
||||
if (!lctx || lctx->version != 2)
|
||||
return 0;
|
||||
}
|
||||
|
||||
opinfo = alloc_opinfo(work, pid, tid);
|
||||
if (!opinfo)
|
||||
return -ENOMEM;
|
||||
|
Loading…
Reference in New Issue
Block a user