Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5401169rdb; Wed, 13 Dec 2023 07:42:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IF0Wh+VaUcm5pKmNWRs1H5gU0VAr4LlbWDi56TP8/EUY0CIpYdeeSQVIO1vBgTD5jKl3I5e X-Received: by 2002:a05:6a20:320f:b0:18c:5c04:5564 with SMTP id hl15-20020a056a20320f00b0018c5c045564mr4193974pzc.60.1702482125166; Wed, 13 Dec 2023 07:42:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702482125; cv=none; d=google.com; s=arc-20160816; b=fL5W7hVuLSirY35hPi8wDoXTZs+GbORpuE1joq4TpGZ6ux45otkdzqWjTEaHXhBEDg MXjDpJRsHAtRwyeeZhoF3fBbIWWedS8I1tRBVyKrkbcKs8gp16od90pu+K5X+0+0UwW7 cXeBgiXZzd7GHFXZ3B32kjTjRCfaD4vMc6/vZAnvkWRMgg0+bKyb/hSVvaHnsjjc/ZSC nX+hQ4frB7xUKD4H0PIj/bl9UkWGzrXtPrNtPzvY92FLtfbO7Qjwy4h7XBW2vleF2T9d 9shomsAq6acj8vO3TfbhzLNgCCinAngcgEkvJMDSsKIkYI5xDg4rjr5Mno1s2dzccPMt mEmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=2oFktIEULbAkj5jUdPt4Q3ozrAu4q3Ve4X5/zahl/is=; fh=ee1YPdrJuYGKrg3MRTp+q3cjybCO3+kPj0hBIW9th3I=; b=olwanC4HbS5RrfstBu8VH6JJ7REiUrY6eAf89e5xxgg7q7EFPIBnt1PgnJmQ0xMNUb fqtV/xfHtVAn/nC2kOxCJ1vkfSaBj66zhpPfDTH16vZoNuBTYUF9w3Q2/dbedu39HFGf ARG5WsRE/cqLbdf9lBwRhl3UPaW+JRWDjOcC+pcHxtY/YcXw8svXv/Uf7FjtP6C1Yz7C POOjAKSJI0IVaIeWk+iRof5woyV6iU9AWyZ7JoidFypApDKyri5IXnaM+DXo6VqTUcc5 wKbavKep1gd4BhcUoDY9BUqhgkIi+v4nEe2neijISqomf4B5JWLNpxy0vpWWnrXA8v4y QBng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Gzpv8wbA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id k3-20020a6568c3000000b005b8fb1da631si9702314pgt.897.2023.12.13.07.42.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 07:42:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Gzpv8wbA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 088CA803B737; Wed, 13 Dec 2023 07:42:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442335AbjLMPls (ORCPT + 99 others); Wed, 13 Dec 2023 10:41:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442294AbjLMPlq (ORCPT ); Wed, 13 Dec 2023 10:41:46 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34D48F7 for ; Wed, 13 Dec 2023 07:41:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702482112; 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; bh=2oFktIEULbAkj5jUdPt4Q3ozrAu4q3Ve4X5/zahl/is=; b=Gzpv8wbAWBbEQic6neEM/OoEma5dzAoxS0//C2BYj9iXDfwHPDvL0i9AXdKOpmWz1lm1Zn VA3mfIlv8aCHrffWlebSo/4egMmb1W8WIf3u7vNorLrRQVFE7O8SYaEqbpFIzD4EFpClP8 DVgv0AiRL42p63vKO/ot2AXcw/NeQTA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-84-_phzeTv5PSOOLdSf851ClQ-1; Wed, 13 Dec 2023 10:41:47 -0500 X-MC-Unique: _phzeTv5PSOOLdSf851ClQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (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 D2FEF101A551; Wed, 13 Dec 2023 15:41:45 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3BC0EC15968; Wed, 13 Dec 2023 15:41:43 +0000 (UTC) From: David Howells To: Jeff Layton , Steve French Cc: David Howells , Matthew Wilcox , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Christian Brauner , linux-cachefs@redhat.com, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 00/13] netfs, cifs: Delegate high-level I/O to netfslib Date: Wed, 13 Dec 2023 15:41:26 +0000 Message-ID: <20231213154139.432922-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 13 Dec 2023 07:42:02 -0800 (PST) Hi Steve, Here are patches to convert cifs to use my netfslib helpers. With this I can run a certain amount of xfstests on CIFS, though I'm running into occasional ksmbd issues and not all the tests work correctly because of fallocate issues. The patches remove around 2000 lines from CIFS This stacks on top of my netfs-lib branch[1]. CIFS notes: (1) CIFS is made to use unbuffered I/O for unbuffered caching modes and write-through caching for cache=strict. (2) Various cifs fallocate() function implementations needed fixing and those fixes are upstream or on the way. (3) It should be possible to turn on multipage folio support in CIFS now. (4) The then-unused CIFS code is removed in three patches, not one, to avoid the git patch generator from producing confusing patches in which it thinks code is being moved around rather than just being removed. The patches can be found here also: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=cifs-netfs Changes ======= ver #4) - Slimmed down the branch: - Split the cifs-related patches off to a separate branch (cifs-netfs) - Deferred the content-encryption to the in-progress ceph changes. - Deferred the use-PG_writeback rather than PG_fscache patch - Rebased on a later linux-next with afs-rotation patches. ver #3) - Moved the fscache module into netfslib to avoid export cycles. - Fixed a bunch of bugs. - Got CIFS to pass as much of xfstests as possible. - Added a patch to make 9P use all the helpers. - Added a patch to stop using PG_fscache, but rather dirty pages on reading and have writepages write to the cache. ver #2) - Folded the addition of NETFS_RREQ_NONBLOCK/BLOCKED into first patch that uses them. - Folded addition of rsize member into first user. - Don't set rsize in ceph (yet) and set it in kafs to 256KiB. cifs sets it dynamically. - Moved direct_bv next to direct_bv_count in struct netfs_io_request and labelled it with a __counted_by(). - Passed flags into netfs_xa_store_and_mark() rather than two bools. - Removed netfs_set_up_buffer() as it wasn't used. David Link: https://lore.kernel.org/r/20231213152350.431591-1-dhowells@redhat.com/ [1] Link: https://lore.kernel.org/r/20231013160423.2218093-1-dhowells@redhat.com/ # v1 Link: https://lore.kernel.org/r/20231117211544.1740466-1-dhowells@redhat.com/ # v2 Link: https://lore.kernel.org/r/20231207212206.1379128-1-dhowells@redhat.com/ # v3 David Howells (13): netfs: Rearrange netfs_io_subrequest to put request pointer first cifs: Replace cifs_readdata with a wrapper around netfs_io_subrequest cifs: Share server EOF pos with netfslib cifs: Set zero_point in the copy_file_range() and remap_file_range() cifs: Replace cifs_writedata with a wrapper around netfs_io_subrequest cifs: Use more fields from netfs_io_subrequest cifs: Make wait_mtu_credits take size_t args cifs: Implement netfslib hooks cifs: Move cifs_loose_read_iter() and cifs_file_write_iter() to file.c cifs: Cut over to using netfslib cifs: Remove some code that's no longer used, part 1 cifs: Remove some code that's no longer used, part 2 cifs: Remove some code that's no longer used, part 3 fs/netfs/buffered_write.c | 3 + fs/netfs/io.c | 7 +- fs/smb/client/Kconfig | 1 + fs/smb/client/cifsfs.c | 86 +- fs/smb/client/cifsfs.h | 10 +- fs/smb/client/cifsglob.h | 59 +- fs/smb/client/cifsproto.h | 14 +- fs/smb/client/cifssmb.c | 111 +- fs/smb/client/file.c | 2908 ++++++---------------------------- fs/smb/client/fscache.c | 109 -- fs/smb/client/fscache.h | 54 - fs/smb/client/inode.c | 27 +- fs/smb/client/smb2ops.c | 28 +- fs/smb/client/smb2pdu.c | 168 +- fs/smb/client/smb2proto.h | 5 +- fs/smb/client/trace.h | 144 +- fs/smb/client/transport.c | 17 +- include/linux/netfs.h | 3 +- include/trace/events/netfs.h | 1 + 19 files changed, 883 insertions(+), 2872 deletions(-)