From patchwork Tue Apr 30 14:09:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13649305 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 83AEFC4345F for ; Tue, 30 Apr 2024 14:09:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 091896B00CD; Tue, 30 Apr 2024 10:09:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 040D46B00CF; Tue, 30 Apr 2024 10:09:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DFCCF6B00D0; Tue, 30 Apr 2024 10:09:58 -0400 (EDT) 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 C08F86B00CD for ; Tue, 30 Apr 2024 10:09:58 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 7E9EA1C0219 for ; Tue, 30 Apr 2024 14:09:58 +0000 (UTC) X-FDA: 82066382076.28.A91C076 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf24.hostedemail.com (Postfix) with ESMTP id C140318001E for ; Tue, 30 Apr 2024 14:09:56 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=D5ZpLyuF; spf=pass (imf24.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=1714486196; 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=iTq0bS5g9R6jgzGNalFqSv7Xb/w6Rjat80pgdhJo5Kk=; b=JE0aqsb1NvZPPh4xp4QHWhigYbvouzQVG1QnRkxXNQV13MxBJa/Kb5uinoSSKiiWfJAiMv BpDuup3XlYe1SVtLwGKy2nzDlpjBoiMxJrAydfZ8bKx2INa7z7MOSVpyieXB96ucEege8s IvPQ/2oxee8oyeDplBrHUK4igRAjXfM= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=D5ZpLyuF; spf=pass (imf24.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714486196; a=rsa-sha256; cv=none; b=ulSqsImtNlUYADYPxB8FeaKAjQyPFSViZd7xa18zZJjzna3XXyD5n48SaUhi0lxg5gQwIR E/k8rtCYxXrEnGX6qrpU1RnAoqMaG4ZfQfYBJkkjMsLUzsajuQQgniw1VdoOiaU8A4UreX MIJ96aJt4/2o2UM8F/j3D04wdZ0x6C8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714486196; 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=iTq0bS5g9R6jgzGNalFqSv7Xb/w6Rjat80pgdhJo5Kk=; b=D5ZpLyuFer2vchyxvv2REXASvgfrHsi+p6GVTQfzWMca1Lnz5EHJ44K1t7/RLvnBQt91SG mnlV+78w0s7LpPbWaquTG2BMQKDrjSEmtzKBRerrVPy476BVjSdD//NUn0a9r1+9UCWqmR YUxTNicyTfnQlTIQLP2aGuefnpOuELI= 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-64--oKur80jNpuvK1_W52Jseg-1; Tue, 30 Apr 2024 10:09:50 -0400 X-MC-Unique: -oKur80jNpuvK1_W52Jseg-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 E8A763C00088; Tue, 30 Apr 2024 14:09:49 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id E51B52166B31; Tue, 30 Apr 2024 14:09:47 +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, linux-kernel@vger.kernel.org, Steve French , Shyam Prasad N , Rohith Surabattula Subject: [PATCH v7 06/16] cifs: Replace the writedata replay bool with a netfs sreq flag Date: Tue, 30 Apr 2024 15:09:18 +0100 Message-ID: <20240430140930.262762-7-dhowells@redhat.com> In-Reply-To: <20240430140930.262762-1-dhowells@redhat.com> References: <20240430140930.262762-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Rspamd-Queue-Id: C140318001E X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: g8ptu98hqfhtnqata8nex3dczkpb5k41 X-HE-Tag: 1714486196-168174 X-HE-Meta: U2Fsd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6FcdvGzCoL5cXBPHMmNoCe3UOGF7UMIjySEap8mfWZwVGwwTBq89MBcbI/iU5mkI8Kfz6SAiWb2ZokYLuF5dgYY/uFYlMxjeoIVN5AgJpKbbldL+QCBDArWKSNikBzdwI4cOph7VsvxUdDylz6aIVK9uGY1YcGoNCtdSK6ZLRfevsbKpQKfB22g3Oy6IGgFNmP+j8FXP/1Gdpz2dq6ZwH+CIODxggUJe7fwwGWmjrsGu4WGdHruMgATZ9NYo77CZuAXmGjcsuRjSu06uBJqeGJF/gzmvinZZuLw1bG3ZXxALnkVt64WRNmMcj0mCMBmr+JMC1E/TREJOlPBoAJF4smrL3D/ovGzSde 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 4d8cd0d82104..7f2ce68d2a2a 100644 --- a/fs/smb/client/file.c +++ b/fs/smb/client/file.c @@ -3325,7 +3325,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 ca8ba6878f9f..b063f5e95f5d 100644 --- a/fs/smb/client/smb2pdu.c +++ b/fs/smb/client/smb2pdu.c @@ -4832,7 +4832,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); /* @@ -4917,7 +4917,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)