From patchwork Fri Mar 31 16:09:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13196202 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 71D4CC77B62 for ; Fri, 31 Mar 2023 16:11:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AF7FD6B00AC; Fri, 31 Mar 2023 12:11:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A81B86B00AD; Fri, 31 Mar 2023 12:11:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 94AF46B00AE; Fri, 31 Mar 2023 12:11:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 84C176B00AC for ; Fri, 31 Mar 2023 12:11:21 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 62812ACA30 for ; Fri, 31 Mar 2023 16:11:21 +0000 (UTC) X-FDA: 80629683162.09.750F3BD Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf08.hostedemail.com (Postfix) with ESMTP id 9D2F016000A for ; Fri, 31 Mar 2023 16:11:19 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=bxWfp94r; spf=pass (imf08.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.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=1680279079; 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=0V0VYuNRGUsctVySLnEH8GinGQ4l5nQcc0Sx6Q5aq0A=; b=HkxWAtGit3Yb+cMeZdn+XvimKd5pvWuUeJGQqkWkb64c3EAD8FGlbUxrIv67q5bCAxliaf yrN+RahX9vQuhSQAeE9POn5cPbwGhnVUC4soffWXG/ikCVELFxi2zYc0P1HTMgR1SlwHoP lFCbjVMcBysIjsxATh3y6ajde5laTbA= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=bxWfp94r; spf=pass (imf08.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.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=1680279079; a=rsa-sha256; cv=none; b=So9paXbESyOUK4H3GAUQRk3HDjFMrkiP8pdzCdaAJAVkqc847LxBmOzYt88LZHmHh64Yh9 ChLhwAa37mwGPV0ZEOcwvZkuUkDhbWtI4OvIIiF0/O520Ht/YPdhWk/xS3GpNBa+uJu23D CxY3uCpt/xDd6pLsCRhCiNykEU89kxE= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680279079; 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=0V0VYuNRGUsctVySLnEH8GinGQ4l5nQcc0Sx6Q5aq0A=; b=bxWfp94rno9l79qgbPG5Jh7EhXksktzGDsyayEQdljpGwvw1J5xK82PQFjHduWHA+It26Z j7vvc30966fhUd2QBFNpmdSIhewqp/9GVGgU4VAdN6WVrzXJOo0BjjMO5gSU1xRpDRrpz+ tLaggZRVQsoFQoH0509zGFR8HRy0afA= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-335-JJSK7rSYNzmbFtG3J_VYoA-1; Fri, 31 Mar 2023 12:11:15 -0400 X-MC-Unique: JJSK7rSYNzmbFtG3J_VYoA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6C1CF29ABA1F; Fri, 31 Mar 2023 16:11:14 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 42ABB40B3EDB; Fri, 31 Mar 2023 16:11:12 +0000 (UTC) From: David Howells To: Matthew Wilcox , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: David Howells , Al Viro , Christoph Hellwig , Jens Axboe , Jeff Layton , Christian Brauner , Chuck Lever III , Linus Torvalds , netdev@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, "Martin K. Petersen" , linux-scsi@vger.kernel.org, target-devel@vger.kernel.org Subject: [PATCH v3 41/55] iscsi: Assume "sendpage" is okay in iscsi_tcp_segment_map() Date: Fri, 31 Mar 2023 17:09:00 +0100 Message-Id: <20230331160914.1608208-42-dhowells@redhat.com> In-Reply-To: <20230331160914.1608208-1-dhowells@redhat.com> References: <20230331160914.1608208-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: 5pxg3ch3fb6zpfox8gghn813n5ghidn3 X-Rspamd-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rGrHSQse3y/95L3d269gHGTPLIs3F0nvXdxRFQ3DOOs5yqp8/bjIYrVSQl4j6qv12D6RkvcGviKeTysT6mTl0Is8gOCXyr86YpW3uE7Vn7rGduzGG0+y/UJWSIO01dfSl6W9CzJNUcRGi7Q/FSowqLII9lzjy3dzB2Fe2zTqVlnbArKNLnANoTuIZMTKt9LdKpBVy/5DspNqODo994BRzn7g9isRMUnnA6BRG/Ef+JULwdinZgsl+GEfEZZlKWJVnfZM4vl+mVQPvgOoKmXmb1qfju9Kps4CzE7hgAs1Ypiw/3wz6LlIlRv+G9yKv1LNm2Z5nW4MsqgpRV/jVQohAbsl2GBy8c9TK9SIbu9mUey44Z2SBwyORE53NakF/FWKZF6F39nMGHBcjOtok9eJ7avPbp+bwLqAbPfjg== 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: As iscsi is now using sendmsg() with MSG_SPLICE_PAGES rather than sendpage, assume that sendpage_ok() will return true in iscsi_tcp_segment_map() and leave it to TCP to copy the data if not. Signed-off-by: David Howells cc: "Martin K. Petersen" cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: Jens Axboe cc: Matthew Wilcox cc: linux-scsi@vger.kernel.org cc: target-devel@vger.kernel.org cc: netdev@vger.kernel.org --- drivers/scsi/libiscsi_tcp.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/scsi/libiscsi_tcp.c b/drivers/scsi/libiscsi_tcp.c index c182aa83f2c9..07ba0d864820 100644 --- a/drivers/scsi/libiscsi_tcp.c +++ b/drivers/scsi/libiscsi_tcp.c @@ -128,18 +128,11 @@ static void iscsi_tcp_segment_map(struct iscsi_segment *segment, int recv) * coalescing neighboring slab objects into a single frag which * triggers one of hardened usercopy checks. */ - if (!recv && sendpage_ok(sg_page(sg))) + if (!recv) return; - if (recv) { - segment->atomic_mapped = true; - segment->sg_mapped = kmap_atomic(sg_page(sg)); - } else { - segment->atomic_mapped = false; - /* the xmit path can sleep with the page mapped so use kmap */ - segment->sg_mapped = kmap(sg_page(sg)); - } - + segment->atomic_mapped = true; + segment->sg_mapped = kmap_atomic(sg_page(sg)); segment->data = segment->sg_mapped + sg->offset + segment->sg_offset; }