Commit 6c8b1a2d authored by Linus Torvalds's avatar Linus Torvalds

Merge tag '6.10-rc-ksmbd-server-fixes' of git://git.samba.org/ksmbd

Pull smb server fixes from Steve French:
 "Two ksmbd server fixes, both for stable"

* tag '6.10-rc-ksmbd-server-fixes' of git://git.samba.org/ksmbd:
  ksmbd: ignore trailing slashes in share paths
  ksmbd: avoid to send duplicate oplock break notifications
parents 54f71b03 405ee409
...@@ -165,8 +165,12 @@ static struct ksmbd_share_config *share_config_request(struct unicode_map *um, ...@@ -165,8 +165,12 @@ static struct ksmbd_share_config *share_config_request(struct unicode_map *um,
share->path = kstrndup(ksmbd_share_config_path(resp), path_len, share->path = kstrndup(ksmbd_share_config_path(resp), path_len,
GFP_KERNEL); GFP_KERNEL);
if (share->path) if (share->path) {
share->path_sz = strlen(share->path); share->path_sz = strlen(share->path);
while (share->path_sz > 1 &&
share->path[share->path_sz - 1] == '/')
share->path[--share->path_sz] = '\0';
}
share->create_mask = resp->create_mask; share->create_mask = resp->create_mask;
share->directory_mask = resp->directory_mask; share->directory_mask = resp->directory_mask;
share->force_create_mode = resp->force_create_mode; share->force_create_mode = resp->force_create_mode;
......
...@@ -610,19 +610,24 @@ static int oplock_break_pending(struct oplock_info *opinfo, int req_op_level) ...@@ -610,19 +610,24 @@ static int oplock_break_pending(struct oplock_info *opinfo, int req_op_level)
if (opinfo->op_state == OPLOCK_CLOSING) if (opinfo->op_state == OPLOCK_CLOSING)
return -ENOENT; return -ENOENT;
else if (opinfo->level <= req_op_level) { else if (opinfo->level <= req_op_level) {
if (opinfo->is_lease && if (opinfo->is_lease == false)
opinfo->o_lease->state != return 1;
(SMB2_LEASE_HANDLE_CACHING_LE |
SMB2_LEASE_READ_CACHING_LE)) if (opinfo->o_lease->state !=
(SMB2_LEASE_HANDLE_CACHING_LE |
SMB2_LEASE_READ_CACHING_LE))
return 1; return 1;
} }
} }
if (opinfo->level <= req_op_level) { if (opinfo->level <= req_op_level) {
if (opinfo->is_lease && if (opinfo->is_lease == false) {
opinfo->o_lease->state != wake_up_oplock_break(opinfo);
(SMB2_LEASE_HANDLE_CACHING_LE | return 1;
SMB2_LEASE_READ_CACHING_LE)) { }
if (opinfo->o_lease->state !=
(SMB2_LEASE_HANDLE_CACHING_LE |
SMB2_LEASE_READ_CACHING_LE)) {
wake_up_oplock_break(opinfo); wake_up_oplock_break(opinfo);
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment