Skip to content

Commit 9ac45ac

Browse files
namjaejeonsmfrench
authored andcommitted
ksmbd: move setting SMB2_FLAGS_ASYNC_COMMAND and AsyncId
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>
1 parent 2a3f785 commit 9ac45ac

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

fs/smb/server/smb2pdu.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -657,21 +657,16 @@ smb2_get_name(const char *src, const int maxlen, struct nls_table *local_nls)
657657

658658
int setup_async_work(struct ksmbd_work *work, void (*fn)(void **), void **arg)
659659
{
660-
struct smb2_hdr *rsp_hdr;
661660
struct ksmbd_conn *conn = work->conn;
662661
int id;
663662

664-
rsp_hdr = ksmbd_resp_buf_next(work);
665-
rsp_hdr->Flags |= SMB2_FLAGS_ASYNC_COMMAND;
666-
667663
id = ksmbd_acquire_async_msg_id(&conn->async_ida);
668664
if (id < 0) {
669665
pr_err("Failed to alloc async message id\n");
670666
return id;
671667
}
672668
work->asynchronous = true;
673669
work->async_id = id;
674-
rsp_hdr->Id.AsyncId = cpu_to_le64(id);
675670

676671
ksmbd_debug(SMB,
677672
"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)
723718
__SMB2_HEADER_STRUCTURE_SIZE);
724719

725720
rsp_hdr = smb2_get_msg(in_work->response_buf);
721+
rsp_hdr->Flags |= SMB2_FLAGS_ASYNC_COMMAND;
722+
rsp_hdr->Id.AsyncId = cpu_to_le64(work->async_id);
726723
smb2_set_err_rsp(in_work);
727724
rsp_hdr->Status = status;
728725

0 commit comments

Comments
 (0)