Skip to content

Commit

Permalink
Merge tag '5.18-rc-ksmbd-server-fixes' of git://git.samba.org/ksmbd
Browse files Browse the repository at this point in the history
Pull ksmbd updates from Steve French:

 - three cleanup fixes

 - shorten module load warning

 - two documentation fixes

* tag '5.18-rc-ksmbd-server-fixes' of git://git.samba.org/ksmbd:
  ksmbd: replace usage of found with dedicated list iterator variable
  ksmbd: Remove a redundant zeroing of memory
  MAINTAINERS: ksmbd: switch Sergey to reviewer
  ksmbd: shorten experimental warning on loading the module
  ksmbd: use netif_is_bridge_port
  Documentation: ksmbd: update Feature Status table
  • Loading branch information
torvalds committed Apr 1, 2022
2 parents 9a005be + edf5f05 commit 7a3ecdd
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Documentation/filesystems/cifs/ksmbd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ Signing Update Supported.
Pre-authentication integrity Supported.
SMB3 encryption(CCM, GCM) Supported. (CCM and GCM128 supported, GCM256 in
progress)
SMB direct(RDMA) Partially Supported. SMB3 Multi-channel is
required to connect to Windows client.
SMB direct(RDMA) Supported.
SMB3 Multi-channel Partially Supported. Planned to implement
replay/retry mechanisms for future.
Receive Side Scaling mode Supported.
SMB3.1.1 POSIX extension Supported.
ACLs Partially Supported. only DACLs available, SACLs
(auditing) is planned for the future. For
Expand Down
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -10668,9 +10668,9 @@ F: tools/testing/selftests/

KERNEL SMB3 SERVER (KSMBD)
M: Namjae Jeon <[email protected]>
M: Sergey Senozhatsky <[email protected]>
M: Steve French <[email protected]>
M: Hyunchul Lee <[email protected]>
R: Sergey Senozhatsky <[email protected]>
L: [email protected]
S: Maintained
T: git git://git.samba.org/ksmbd.git
Expand Down
2 changes: 1 addition & 1 deletion fs/ksmbd/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ static int __init ksmbd_server_init(void)
if (ret)
goto err_crypto_destroy;

pr_warn_once("The ksmbd server is experimental, use at your own risk.\n");
pr_warn_once("The ksmbd server is experimental\n");

return 0;

Expand Down
23 changes: 11 additions & 12 deletions fs/ksmbd/smb2pdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -6607,8 +6607,7 @@ int smb2_cancel(struct ksmbd_work *work)
struct ksmbd_conn *conn = work->conn;
struct smb2_hdr *hdr = smb2_get_msg(work->request_buf);
struct smb2_hdr *chdr;
struct ksmbd_work *cancel_work = NULL;
int canceled = 0;
struct ksmbd_work *cancel_work = NULL, *iter;
struct list_head *command_list;

ksmbd_debug(SMB, "smb2 cancel called on mid %llu, async flags 0x%x\n",
Expand All @@ -6618,44 +6617,44 @@ int smb2_cancel(struct ksmbd_work *work)
command_list = &conn->async_requests;

spin_lock(&conn->request_lock);
list_for_each_entry(cancel_work, command_list,
list_for_each_entry(iter, command_list,
async_request_entry) {
chdr = smb2_get_msg(cancel_work->request_buf);
chdr = smb2_get_msg(iter->request_buf);

if (cancel_work->async_id !=
if (iter->async_id !=
le64_to_cpu(hdr->Id.AsyncId))
continue;

ksmbd_debug(SMB,
"smb2 with AsyncId %llu cancelled command = 0x%x\n",
le64_to_cpu(hdr->Id.AsyncId),
le16_to_cpu(chdr->Command));
canceled = 1;
cancel_work = iter;
break;
}
spin_unlock(&conn->request_lock);
} else {
command_list = &conn->requests;

spin_lock(&conn->request_lock);
list_for_each_entry(cancel_work, command_list, request_entry) {
chdr = smb2_get_msg(cancel_work->request_buf);
list_for_each_entry(iter, command_list, request_entry) {
chdr = smb2_get_msg(iter->request_buf);

if (chdr->MessageId != hdr->MessageId ||
cancel_work == work)
iter == work)
continue;

ksmbd_debug(SMB,
"smb2 with mid %llu cancelled command = 0x%x\n",
le64_to_cpu(hdr->MessageId),
le16_to_cpu(chdr->Command));
canceled = 1;
cancel_work = iter;
break;
}
spin_unlock(&conn->request_lock);
}

if (canceled) {
if (cancel_work) {
cancel_work->state = KSMBD_WORK_CANCELLED;
if (cancel_work->cancel_fn)
cancel_work->cancel_fn(cancel_work->cancel_argv);
Expand Down Expand Up @@ -8484,7 +8483,7 @@ static void fill_transform_hdr(void *tr_buf, char *old_buf, __le16 cipher_type)
struct smb2_hdr *hdr = smb2_get_msg(old_buf);
unsigned int orig_len = get_rfc1002_len(old_buf);

memset(tr_buf, 0, sizeof(struct smb2_transform_hdr) + 4);
/* tr_buf must be cleared by the caller */
tr_hdr->ProtocolId = SMB2_TRANSFORM_PROTO_NUM;
tr_hdr->OriginalMessageSize = cpu_to_le32(orig_len);
tr_hdr->Flags = cpu_to_le16(TRANSFORM_FLAG_ENCRYPTED);
Expand Down
4 changes: 2 additions & 2 deletions fs/ksmbd/transport_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ static int ksmbd_netdev_event(struct notifier_block *nb, unsigned long event,

switch (event) {
case NETDEV_UP:
if (netdev->priv_flags & IFF_BRIDGE_PORT)
if (netif_is_bridge_port(netdev))
return NOTIFY_OK;

list_for_each_entry(iface, &iface_list, entry) {
Expand Down Expand Up @@ -585,7 +585,7 @@ int ksmbd_tcp_set_interfaces(char *ifc_list, int ifc_list_sz)

rtnl_lock();
for_each_netdev(&init_net, netdev) {
if (netdev->priv_flags & IFF_BRIDGE_PORT)
if (netif_is_bridge_port(netdev))
continue;
if (!alloc_iface(kstrdup(netdev->name, GFP_KERNEL)))
return -ENOMEM;
Expand Down

0 comments on commit 7a3ecdd

Please sign in to comment.