From patchwork Thu Feb 16 21:47:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13144025 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 72BC8C636D6 for ; Thu, 16 Feb 2023 21:49:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7F94B6B008A; Thu, 16 Feb 2023 16:48:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7D22B6B008C; Thu, 16 Feb 2023 16:48:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6708F6B0092; Thu, 16 Feb 2023 16:48:59 -0500 (EST) 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 51F4F6B008A for ; Thu, 16 Feb 2023 16:48:59 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 2FDB21C617F for ; Thu, 16 Feb 2023 21:48:59 +0000 (UTC) X-FDA: 80474495598.01.4B4137D Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf28.hostedemail.com (Postfix) with ESMTP id 762C8C001B for ; Thu, 16 Feb 2023 21:48:57 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=HxYtvd1V; spf=pass (imf28.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=1676584137; 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=41+Q30ZI9D1dRm8dDNs28BfljdF5S2Rwn6LqsfU1dM4=; b=txhZi5k0AOecA3VXpasPBu3AYFgXtuoM3WGQ4+VHzzCUPGNQ9sO0CTwNF9lF7i+Nf98frC GFaoLsXzC6xMH2mqa35wxPcBnZDVe0OWFUftQUa8jGGvc8vOeIixlbQ9/kV5qZTdrUW6sF Sd6Nlm2dnh/clw1a+3G2D0LUpZx/aCs= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=HxYtvd1V; spf=pass (imf28.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=1676584137; a=rsa-sha256; cv=none; b=qU5TOQWHs7bd/1HG+SMP5YZXXls1UK94oFsN97E/keDfaFjW7F8gSSGueCNULZ9H07neE+ Ui531XhhfKp8mdKf387G3XpFeuQ3gQhvlMPzVewdcV/IJ2QM9fIZAxkCd6CVCb1vfgcLeg W8rw9b5pqWaIqP+8JSc9MlGxzWRJ7E4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676584136; 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=41+Q30ZI9D1dRm8dDNs28BfljdF5S2Rwn6LqsfU1dM4=; b=HxYtvd1VMbm2KIybTCzYks0I41uhZbsjGGl7ZsAzK+pUzqJ8eMJgvqnTfGbrkuJhk3uRju Cmem1fudYE1/QrnKI3j6uRlH9mkxibIYN04QjTt9fvgQXGYyZAxgUUCrt+FX4N5t0jgrBk JYV3qic9ft566tq0CdKDAqPPELLa+2M= 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-608-VO6ytfueMLuoZZiqci4i-A-1; Thu, 16 Feb 2023 16:48:55 -0500 X-MC-Unique: VO6ytfueMLuoZZiqci4i-A-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 632A71C05EB1; Thu, 16 Feb 2023 21:48:54 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8077F2166B30; Thu, 16 Feb 2023 21:48:52 +0000 (UTC) From: David Howells To: Steve French Cc: David Howells , Jens Axboe , Al Viro , Shyam Prasad N , Rohith Surabattula , Tom Talpey , Stefan Metzmacher , Christoph Hellwig , Matthew Wilcox , Jeff Layton , linux-cifs@vger.kernel.org, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Steve French Subject: [PATCH 17/17] cifs: DIO to/from KVEC-type iterators should now work Date: Thu, 16 Feb 2023 21:47:45 +0000 Message-Id: <20230216214745.3985496-18-dhowells@redhat.com> In-Reply-To: <20230216214745.3985496-1-dhowells@redhat.com> References: <20230216214745.3985496-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: s9urwmruxm7tzhqusrsbo1x3g4szjyem X-Rspamd-Queue-Id: 762C8C001B X-HE-Tag: 1676584137-970469 X-HE-Meta: U2FsdGVk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jxmyZ/35bDLwFGbtGtRb6r87WPRL6ocfBdyy00NLilBb4WWivVZBi7Rgz8rsgpb1pCv61XjdFcbZzkTGbW+/VNQVCzpNf3TWY2xh4GoWo/ljr2nRvAL/qNSdl7mv1KwJj/D33AwdFo890tkfYdilWzFhgbE6WHWOsox3Oi1+pAlaKR3SqV+u+62v6F6uv+IqkIPtwb2TRg7aF/MGQfhx/8K/vEFFO0ZZwtJPlYjhWf0qacWZPoUJtOjkAHffda7VNEwL2sjRdvoMFjohW/ULxWsQX00fQ0KmBERSDZ5cedN2oOqzOKJ9vLjiBfDyIAT18ZbO3mMyNWcDeBa2qbW+k5TEKeuXPkkK73VXnztxLlZh8asQXC68sFQFcpnA== 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: DIO to/from KVEC-type iterators should now work as the iterator is passed down to the socket in non-RDMA/non-crypto mode and in RDMA or crypto mode care is taken to handle vmap/vmalloc correctly and not take page refs when building a scatterlist. Signed-off-by: David Howells cc: Steve French cc: Shyam Prasad N cc: Rohith Surabattula cc: Tom Talpey cc: Jeff Layton cc: linux-cifs@vger.kernel.org --- fs/cifs/file.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 60949fc352ed..6969699632dc 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -3549,16 +3549,6 @@ static ssize_t __cifs_writev( struct cifs_aio_ctx *ctx; int rc; - /* - * iov_iter_get_pages_alloc doesn't work with ITER_KVEC. - * In this case, fall back to non-direct write function. - * this could be improved by getting pages directly in ITER_KVEC - */ - if (direct && iov_iter_is_kvec(from)) { - cifs_dbg(FYI, "use non-direct cifs_writev for kvec I/O\n"); - direct = false; - } - rc = generic_write_checks(iocb, from); if (rc <= 0) return rc; @@ -4092,16 +4082,6 @@ static ssize_t __cifs_readv( loff_t offset = iocb->ki_pos; struct cifs_aio_ctx *ctx; - /* - * iov_iter_get_pages_alloc() doesn't work with ITER_KVEC, - * fall back to data copy read path - * this could be improved by getting pages directly in ITER_KVEC - */ - if (direct && iov_iter_is_kvec(to)) { - cifs_dbg(FYI, "use non-direct cifs_user_readv for kvec I/O\n"); - direct = false; - } - len = iov_iter_count(to); if (!len) return 0;