From patchwork Thu Mar 28 16:57:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13609175 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3AF8CD1284 for ; Thu, 28 Mar 2024 16:59:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8F1B66B00CE; Thu, 28 Mar 2024 12:59:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8A16F6B00CF; Thu, 28 Mar 2024 12:59:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 799F56B00D0; Thu, 28 Mar 2024 12:59:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 5CC0D6B00CE for ; Thu, 28 Mar 2024 12:59:49 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 2785A40373 for ; Thu, 28 Mar 2024 16:59:49 +0000 (UTC) X-FDA: 81947059698.28.0F59234 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf26.hostedemail.com (Postfix) with ESMTP id 6FE22140021 for ; Thu, 28 Mar 2024 16:59:47 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=NB3ALg1u; spf=pass (imf26.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711645187; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=FP3I6/3Lail3PRtRjCFYUrK7RtWmkgk5AkVOW5arfmM=; b=sdxKKxwVbV8wkM0PHTBHe9pppy/QIdvMcmyyW2FM53rgUyfAE0y2DugR6hfy8KZdoLVt5P PrOUsAquqroRaFczLuInQiRGjpyaxEbqqb/YllGJmx7e362mXe8tikryJrVQTnvYNs8q8R AlEAdWO1WGxIJLdDIRTsnp+rUXHuIQU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711645187; a=rsa-sha256; cv=none; b=V0ralMgyr981TNoaDo9D0IHxloLtqySwST1ToVa91P5KnH65LBplGixtNStEIrnie+3jNo Va7iQmqtorlT/R9Ie0urW335KR6wHlF3JqdgmvbUtlRStskyfvz508y1nzLDNxtMuXHNRi L7aCTbJSi1CZdSp2uhlACPdD63oY8Yk= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=NB3ALg1u; spf=pass (imf26.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711645186; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FP3I6/3Lail3PRtRjCFYUrK7RtWmkgk5AkVOW5arfmM=; b=NB3ALg1uL8n59eM1cXyUvKLeFcXNDR4v5p2YxqJuUJzt4xcAbQJ44G+tyhaXi48dPSN8YY kQ8qc6nCeRmoTdhPlq8zOhNUlEKMVwmHIx8odBOsp7533356dmxg1dcZB5AOhU75qqAdhz 5FiOzXGBPSgsmszfSQGLDqmihIW8eV8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-130--_LPE4uLM_G2IXbLkWEMMQ-1; Thu, 28 Mar 2024 12:59:43 -0400 X-MC-Unique: -_LPE4uLM_G2IXbLkWEMMQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B0A5680026D; Thu, 28 Mar 2024 16:59:42 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.146]) by smtp.corp.redhat.com (Postfix) with ESMTP id C5C27C4C7A0; Thu, 28 Mar 2024 16:59:40 +0000 (UTC) From: David Howells To: Steve French Cc: David Howells , Jeff Layton , Matthew Wilcox , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Christian Brauner , netfs@lists.linux.dev, linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Steve French , Shyam Prasad N , Rohith Surabattula Subject: [PATCH v6 05/15] cifs: Replace the writedata replay bool with a netfs sreq flag Date: Thu, 28 Mar 2024 16:57:56 +0000 Message-ID: <20240328165845.2782259-6-dhowells@redhat.com> In-Reply-To: <20240328165845.2782259-1-dhowells@redhat.com> References: <20240328165845.2782259-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Rspamd-Queue-Id: 6FE22140021 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: 4z86emtdtibt36mcp5hjannyqdxbp95a X-HE-Tag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H9ij5mQ36gs/Eybsbh/1m/5ksW9I2ToWPhXqsIHkvv+v4BXAUB5mb+hFpUyEJq5vkvtn4Iyw+f/O40qWCNb1HWm54gzv029KGjOc8FzVlmnCfg1rkfXoTZVUg2WGwUufJAix7SOSu1BWsEwh5cjJRxDHAaZhcT5z9GVFsqL42SvG159NCOISL0I1Wq7c1R4UfhpoVtpB8t8yckb5oechqjVZTRrnJzXuoh0xVEW63LktZoVR35XT/3gvSbWw79oPbRXt5ptGwHo6YPKFwCKMyzv0qj5HpJ6xoBYFutZ0fssO+3oDPyeP93TlQgOu/J6y4/lcpoJ3gqaFagFs4+z72snOH/UiSo0waotn4PExxMPjgCv4K3FjC4hxZP+DZWdvkTPj6 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Replace the 'replay' bool in cifs_writedata (now cifs_io_subrequest) with a flag in the netfs_io_subrequest flags. Signed-off-by: David Howells cc: Steve French cc: Shyam Prasad N cc: Rohith Surabattula cc: Jeff Layton cc: linux-cifs@vger.kernel.org cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org --- fs/smb/client/file.c | 2 +- fs/smb/client/smb2pdu.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c index 76bfefa9b669..6f6459b506d1 100644 --- a/fs/smb/client/file.c +++ b/fs/smb/client/file.c @@ -3246,7 +3246,7 @@ cifs_resend_wdata(struct cifs_io_subrequest *wdata, struct list_head *wdata_list if (wdata->cfile->invalidHandle) rc = -EAGAIN; else { - wdata->replay = true; + set_bit(NETFS_SREQ_RETRYING, &wdata->subreq.flags); #ifdef CONFIG_CIFS_SMB_DIRECT if (wdata->mr) { wdata->mr->need_invalidate = true; diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c index ddd69db1f0a8..2e29c6c2dca6 100644 --- a/fs/smb/client/smb2pdu.c +++ b/fs/smb/client/smb2pdu.c @@ -4819,7 +4819,7 @@ smb2_async_writev(struct cifs_io_subrequest *wdata) struct cifs_io_parms *io_parms = NULL; int credit_request; - if (!wdata->server || wdata->replay) + if (!wdata->server || test_bit(NETFS_SREQ_RETRYING, &wdata->subreq.flags)) server = wdata->server = cifs_pick_channel(tcon->ses); /* @@ -4904,7 +4904,7 @@ smb2_async_writev(struct cifs_io_subrequest *wdata) rqst.rq_nvec = 1; rqst.rq_iter = wdata->subreq.io_iter; rqst.rq_iter_size = iov_iter_count(&rqst.rq_iter); - if (wdata->replay) + if (test_bit(NETFS_SREQ_RETRYING, &wdata->subreq.flags)) smb2_set_replay(server, &rqst); #ifdef CONFIG_CIFS_SMB_DIRECT if (wdata->mr)