From patchwork Mon Feb 5 22:57:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13546382 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 2CD01C4828D for ; Mon, 5 Feb 2024 22:58:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 489466B009C; Mon, 5 Feb 2024 17:57:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 325CD6B009D; Mon, 5 Feb 2024 17:57:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 12AB26B009E; Mon, 5 Feb 2024 17:57:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id F16A66B009C for ; Mon, 5 Feb 2024 17:57:56 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id D0CAC1A0AA2 for ; Mon, 5 Feb 2024 22:57:56 +0000 (UTC) X-FDA: 81759264552.09.559B55D Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf17.hostedemail.com (Postfix) with ESMTP id 2876640009 for ; Mon, 5 Feb 2024 22:57:54 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=FdeI9Oso; spf=pass (imf17.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=1707173875; 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=3wa+MhW5WY7m0Mgt6HSqvOGHHNP0rK9YvsBe6EDxi5k=; b=XFJWURcziqB+KenQME8JYtHzl+rAK6CV3AiJ4QO5tfsL+WsBxs5PCAGmtAa6O5zh0aK5BP ikHv4EqhwdTr5d+hQaXNYYachSxNOT72nxhUcaH1xIUL7De/vxVlzsHlCapSkblXscR+fm lpF/LUBZnlL31ZKo2dFIIeqK5CiUbCw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707173875; a=rsa-sha256; cv=none; b=hlQsXqXGVPHoL1UNa8L2K2oPNdgNDP0ces4JvHUo4R+gDO/TkXcpo+SoUWIVtahDql9UUD cV+00fJLgjmmmTn+BP50XSOxC+ihQW5b4pOA5rl94TPn4HmNgMWbH0jSaTvTtNHQAPrjR6 76TApzJ5MhJ3Uv8ApBX/Ncyf2YBBJa0= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=FdeI9Oso; spf=pass (imf17.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=1707173874; 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=3wa+MhW5WY7m0Mgt6HSqvOGHHNP0rK9YvsBe6EDxi5k=; b=FdeI9Oso9kHnSBAuS6Tde9+wqwMCk0DcVgNQKE6rqsr82/3/BQVQABO0ZqX8Qql/9RjRNw ZKzvEk9A9p5EqCW0xgDctT4pfvz52WCHCgoosuD1kkSXUvB5kkcGwk+7NzC54A082ccv4P 8CnkfyHz9xP3jKCPlWQc7E2zmN3r7cE= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-588-QlhvDllSPfKdJhAef6Pv0g-1; Mon, 05 Feb 2024 17:57:51 -0500 X-MC-Unique: QlhvDllSPfKdJhAef6Pv0g-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (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 1131F3CBD509; Mon, 5 Feb 2024 22:57:50 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.245]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1EAB02166B31; Mon, 5 Feb 2024 22:57:48 +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 v5 07/12] cifs: Replace the writedata replay bool with a netfs sreq flag Date: Mon, 5 Feb 2024 22:57:19 +0000 Message-ID: <20240205225726.3104808-8-dhowells@redhat.com> In-Reply-To: <20240205225726.3104808-1-dhowells@redhat.com> References: <20240205225726.3104808-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Rspamd-Queue-Id: 2876640009 X-Rspam-User: X-Stat-Signature: 3fbqpnipddxfceaa4idne534n4paysrb X-Rspamd-Server: rspam03 X-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aldDpzNVK+Em2kvBQyKoerDk8FgSIi32f5LI+Aif7MiHZEJAYr030y+JGTfzw4TuVRTKWr1dR5ZY4p8RK8yMYUm6gBFUcybiY5CZYTLYbP+XdM+y0axVhT5/SZPNMOuQptAe8zQLd5olxP+PsquDgrlk1/daEc1am1vXuci8GiX+xLMbD1x2oUAAG92xo9XcUeFj0ePCQUGYBoIuwV0Resxc8vu23uBuXo3jxkQUarEesxF6Y5endx75vYHtwlG7bjRuVjaB9P0S/Bq4O8B5nRsqN3fzWdJKtKXlq5x9R+g0ncHcV5feYKCDr+zcMWh+dKBUvVixGbWg8Qb+gZlRECXdi/9q83i85QDHixtWggcTJyxOQEhvwrYoP3lb9I/6KtE70obSv2D 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/cifsglob.h | 1 - fs/smb/client/file.c | 2 +- fs/smb/client/smb2pdu.c | 4 ++-- include/linux/netfs.h | 1 + 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/smb/client/cifsglob.h b/fs/smb/client/cifsglob.h index dd0cef742a64..1dfed3eddaa2 100644 --- a/fs/smb/client/cifsglob.h +++ b/fs/smb/client/cifsglob.h @@ -1479,7 +1479,6 @@ struct cifs_io_subrequest { unsigned int xid; int result; bool have_credits; - bool replay; struct kvec iov[2]; struct TCP_Server_Info *server; #ifdef CONFIG_CIFS_SMB_DIRECT diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c index ce5f24206be0..14602ed6bc39 100644 --- a/fs/smb/client/file.c +++ b/fs/smb/client/file.c @@ -3645,7 +3645,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 2ecc5f210329..84e3675eb41e 100644 --- a/fs/smb/client/smb2pdu.c +++ b/fs/smb/client/smb2pdu.c @@ -4797,7 +4797,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); /* @@ -4882,7 +4882,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) diff --git a/include/linux/netfs.h b/include/linux/netfs.h index 61195cf16d6e..455ccfe8bffa 100644 --- a/include/linux/netfs.h +++ b/include/linux/netfs.h @@ -224,6 +224,7 @@ struct netfs_io_subrequest { #define NETFS_SREQ_SEEK_DATA_READ 3 /* Set if ->read() should SEEK_DATA first */ #define NETFS_SREQ_NO_PROGRESS 4 /* Set if we didn't manage to read any data */ #define NETFS_SREQ_ONDEMAND 5 /* Set if it's from on-demand read mode */ +#define NETFS_SREQ_RETRYING 6 /* Set if we're retrying the op */ }; enum netfs_io_origin {