mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
ksmbd: move setting SMB2_FLAGS_ASYNC_COMMAND and AsyncId
[ Upstream commit 9ac45ac7cf65b0623ceeab9b28b307a08efa22dc ] Directly set SMB2_FLAGS_ASYNC_COMMAND flags and AsyncId in smb2 header of interim response instead of current response header. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d9aa5c1908
commit
0bc46c2370
@@ -657,13 +657,9 @@ smb2_get_name(const char *src, const int maxlen, struct nls_table *local_nls)
|
|||||||
|
|
||||||
int setup_async_work(struct ksmbd_work *work, void (*fn)(void **), void **arg)
|
int setup_async_work(struct ksmbd_work *work, void (*fn)(void **), void **arg)
|
||||||
{
|
{
|
||||||
struct smb2_hdr *rsp_hdr;
|
|
||||||
struct ksmbd_conn *conn = work->conn;
|
struct ksmbd_conn *conn = work->conn;
|
||||||
int id;
|
int id;
|
||||||
|
|
||||||
rsp_hdr = ksmbd_resp_buf_next(work);
|
|
||||||
rsp_hdr->Flags |= SMB2_FLAGS_ASYNC_COMMAND;
|
|
||||||
|
|
||||||
id = ksmbd_acquire_async_msg_id(&conn->async_ida);
|
id = ksmbd_acquire_async_msg_id(&conn->async_ida);
|
||||||
if (id < 0) {
|
if (id < 0) {
|
||||||
pr_err("Failed to alloc async message id\n");
|
pr_err("Failed to alloc async message id\n");
|
||||||
@@ -671,7 +667,6 @@ int setup_async_work(struct ksmbd_work *work, void (*fn)(void **), void **arg)
|
|||||||
}
|
}
|
||||||
work->asynchronous = true;
|
work->asynchronous = true;
|
||||||
work->async_id = id;
|
work->async_id = id;
|
||||||
rsp_hdr->Id.AsyncId = cpu_to_le64(id);
|
|
||||||
|
|
||||||
ksmbd_debug(SMB,
|
ksmbd_debug(SMB,
|
||||||
"Send interim Response to inform async request id : %d\n",
|
"Send interim Response to inform async request id : %d\n",
|
||||||
@@ -723,6 +718,8 @@ void smb2_send_interim_resp(struct ksmbd_work *work, __le32 status)
|
|||||||
__SMB2_HEADER_STRUCTURE_SIZE);
|
__SMB2_HEADER_STRUCTURE_SIZE);
|
||||||
|
|
||||||
rsp_hdr = smb2_get_msg(in_work->response_buf);
|
rsp_hdr = smb2_get_msg(in_work->response_buf);
|
||||||
|
rsp_hdr->Flags |= SMB2_FLAGS_ASYNC_COMMAND;
|
||||||
|
rsp_hdr->Id.AsyncId = cpu_to_le64(work->async_id);
|
||||||
smb2_set_err_rsp(in_work);
|
smb2_set_err_rsp(in_work);
|
||||||
rsp_hdr->Status = status;
|
rsp_hdr->Status = status;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user