From patchwork Fri May 27 10:43:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 12863253 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E265C433EF for ; Fri, 27 May 2022 10:44:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351010AbiE0KoE (ORCPT ); Fri, 27 May 2022 06:44:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350625AbiE0KoD (ORCPT ); Fri, 27 May 2022 06:44:03 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2B29B40922 for ; Fri, 27 May 2022 03:44:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653648240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NHkSj7X5NKgJK27qI3S4gtnz+ks1f17QdsvgCRP5aYk=; b=YpFlwA3rdcMW7SjOE2UlVl1edVdIfC1u6+l+ktDWEZH0Z2I0OdPH9mCdpWAi31VzQ0Hp07 5w1Es6Ftb4BUiopYojm+KWVtOS7scEFyeqwADCSVfCZfgGkEs8gMXeXY+2SrdjdBLkWKWf kX5y1hQM0qpjAtSyshlF+O2YB8hgrAU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-96-qgV3NnC9Nl-1jS02mYygBA-1; Fri, 27 May 2022 06:43:58 -0400 X-MC-Unique: qgV3NnC9Nl-1jS02mYygBA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 67CD4101AA46; Fri, 27 May 2022 10:43:57 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0A789C27E8F; Fri, 27 May 2022 10:43:55 +0000 (UTC) Subject: [PATCH v3 0/9] cifs: Use iov_iters down to the network transport From: David Howells To: Steve French Cc: linux-cifs@vger.kernel.org, Shyam Prasad N , Rohith Surabattula , Steve French , dhowells@redhat.com, Shyam Prasad N , Rohith Surabattula , Jeff Layton , Al Viro , linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Date: Fri, 27 May 2022 11:43:55 +0100 Message-ID: <165364823513.3334034.11209090728654641458.stgit@warthog.procyon.org.uk> User-Agent: StGit/1.4 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Hi Steve, Here's a third version of a subset of my cifs-experimental branch. It alters the cifs driver to pass iov_iters down to the lowest layers where they can be passed to the network transport. ver #3) - I fixed some things in the RDMA interface after running xfstests. It now correctly chops up requests so that they'll actually fit within the available SGE slots, both for short and bulk requests. - I also fixed both the cifs_readahead and cifs_writepages algorithms, so those now work properly - and I found and fixed a memory leak too. cifs over softRoCE RDMA got as far as generic/138 before the RXE driver deadlocked itself. I've posted a bug report for that. Lockdep spotted the bug right away on mount. cifs over softIWarp RDMA got as far as generic/006 before triggering a UAF in the reconnect code, spotted by KASAN. Both this and the above fail on the vanilla kernel also. Beyond the 6 main patches, there are two patches which add some trace points (if they look of interest to you, I can properly fill out the commit log) and the patch to make softiwarp work - all three of which can be dropped. I've pushed the patches here also: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=cifs-for-sfrench David --- David Howells (8): iov_iter: Add a function to extract an iter's buffers to a bvec iter iov_iter: Add a general purpose iteration function cifs: Add some helper functions cifs: Add a function to read into an iter from a socket cifs: Change the I/O paths to use an iterator rather than a page list cifs: Remove unused code cifs: Trace writedata page wrangling cifs: Add some RDMA send tracepoints Namjae Jeon (1): cifs, ksmbd: Fix MAX_SGE count for softiwarp fs/cifs/cifsencrypt.c | 40 +- fs/cifs/cifsfs.h | 6 + fs/cifs/cifsglob.h | 29 +- fs/cifs/cifsproto.h | 11 +- fs/cifs/cifssmb.c | 276 +++++-- fs/cifs/connect.c | 16 + fs/cifs/file.c | 1434 ++++++++++++++----------------------- fs/cifs/fscache.c | 22 +- fs/cifs/fscache.h | 10 +- fs/cifs/misc.c | 109 --- fs/cifs/smb2ops.c | 367 +++++----- fs/cifs/smb2pdu.c | 44 +- fs/cifs/smbdirect.c | 335 ++++----- fs/cifs/smbdirect.h | 6 +- fs/cifs/trace.h | 161 +++++ fs/cifs/transport.c | 37 +- fs/ksmbd/transport_rdma.c | 2 +- include/linux/uio.h | 8 + lib/iov_iter.c | 133 ++++ 19 files changed, 1470 insertions(+), 1576 deletions(-)