Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2968871rdb; Mon, 4 Dec 2023 12:34:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IEZ3fH3Nbya3jMwJT4a7VRr+V8vd99ihByW9p1EEtT+d0ONQ8BTgC5nbD+PtF0iOJ4TKlr/ X-Received: by 2002:a17:903:2348:b0:1d0:6ffd:6e6a with SMTP id c8-20020a170903234800b001d06ffd6e6amr2591724plh.98.1701722052140; Mon, 04 Dec 2023 12:34:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701722052; cv=none; d=google.com; s=arc-20160816; b=OeRX3/KGwGHutMEgRSij+NOkggZ9Nbop8dS+95QiDZOueutGMBskPHAq+kKpyVktQr qcHU1+i8mkjvgIQc4/5fFm+G4+oO9P6WBIMcbfVJ7EcCOKZI+lJTvI6qwmU7ZcliN/2Q hi5pHqCx+iBsIvgYKcj584leQcXDk5zvdaRZVKTs7gLY/8VnI94Jmi/BoGfVJgd84kTi LD8bs5WWj0tE1kk6gpfHNY+OYae/LSbxbWMN+/ig9WkunsxkNOXGyu7JpUEaiJtIXImH bFMNvsJlz19SnAUgUIRuq2t/HquVIazrGaIX2V4+OL0XfBskSH4Sy3pZx//BzSyzooDf 0SUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jUrlPKgXUrWIc1AjdZFRG1XnUwE+aTPlK/uwr/76j4o=; fh=YCpWGDe4dlD/Msuo/KjbMNPS2Hvd2LSPoVlNK8Y+dew=; b=B8/NaztO40k9+7qcsvUim1lezOm1iZB7iR8p8xYYeCsst2VjVzrMJQWzeWQRhrpa8W CBQ2w1Du+xTOXjfTqCW4qoTrwVBHImNIXu7nXEb7pwDjGaOvsAaewutDDkHkj3/hjgGR Qux2MrHnoGiSQBvW6keYAhFnjt7w/Cue70KC1HtGy0IkNITSyw3brH2wmNzvjQ69UXAv D09PBZXvAqfhP1U7iqB2Ec7XCyshicDJD11gjB20yvWAh5acYQowQOYh8kH2JBx12JHy 20DZXSBQsFDcGezK4RR9V+phT0+YyHlI+yIhiUeAhVQ/BQIprPofkmdQ/shdWNnf2rrN oW6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cdQghO4r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id h6-20020a170902f7c600b001d044fd25easi7482226plw.391.2023.12.04.12.34.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 12:34:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cdQghO4r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 5E7798078610; Mon, 4 Dec 2023 12:34:09 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346253AbjLDUdw (ORCPT + 99 others); Mon, 4 Dec 2023 15:33:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235500AbjLDUdg (ORCPT ); Mon, 4 Dec 2023 15:33:36 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 709F0D6F for ; Mon, 4 Dec 2023 12:33:40 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8CB0C433C8; Mon, 4 Dec 2023 20:33:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701722019; bh=h0/53uKqJP9rqBgpQtyJ/HFjcSItrRZENrMDnnnrps8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cdQghO4rId+dxZJpuSVEqen+dbLCr+Us80zVQvSXHELoCu4q3QmN6zAvvYhDctyA2 R97ggW55cM9M3Ybn65KAGccE+QYi+MSWAy2W+OHAyxJaLgZpWVzfM8kWm3bMSkaL6C ZcGN7a10C7WYIm+n+jAp7fZ0DfHWqfxD2C7qLkz+euj2DRLC3UpWJyoC1cbc6DMoiY zHfGfBf5OzfE6OnU05Fuoi6NEodr3sad0Y9FRtgJxdkV5Hi+ka7ApNbOzB171Q6qIi s2AuF8B3xVFYj9SnRw4S0uDn6JWr0Xh6Dauq5KQXkcy+Mbj6xpq21g2UzGIpR42p0b uhkr2qklN6VAA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Namjae Jeon , Steve French , Sasha Levin , sfrench@samba.org, linux-cifs@vger.kernel.org Subject: [PATCH AUTOSEL 6.6 08/32] ksmbd: move setting SMB2_FLAGS_ASYNC_COMMAND and AsyncId Date: Mon, 4 Dec 2023 15:32:28 -0500 Message-ID: <20231204203317.2092321-8-sashal@kernel.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231204203317.2092321-1-sashal@kernel.org> References: <20231204203317.2092321-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.6.4 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 04 Dec 2023 12:34:09 -0800 (PST) From: Namjae Jeon [ 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 Signed-off-by: Steve French Signed-off-by: Sasha Levin --- fs/smb/server/smb2pdu.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c index a85f3cc7c181f..7eaac1098f637 100644 --- a/fs/smb/server/smb2pdu.c +++ b/fs/smb/server/smb2pdu.c @@ -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) { - struct smb2_hdr *rsp_hdr; struct ksmbd_conn *conn = work->conn; 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); if (id < 0) { 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->async_id = id; - rsp_hdr->Id.AsyncId = cpu_to_le64(id); ksmbd_debug(SMB, "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); 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); rsp_hdr->Status = status; -- 2.42.0