Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp181422lqp; Tue, 11 Jun 2024 20:08:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXXKEArbWr4tBzKwzifoWqOYWid/CjL+VpFWR8SURNuIyuoS5LyuYedUNKy6vu20P8HerIXPtXecYJOjQ5GZZdUDr4LUEDR9ncfd2IvEg== X-Google-Smtp-Source: AGHT+IH8xRSbGnqn5Ha7lmVrGrp9U12m/aJQzd3kZ9y2MEXOmbEN5zyvnw4NeuXI+g1WvokdTJkb X-Received: by 2002:a05:6a20:7489:b0:1b7:2fa7:4168 with SMTP id adf61e73a8af0-1b8a9c22af1mr845792637.18.1718161716059; Tue, 11 Jun 2024 20:08:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718161716; cv=pass; d=google.com; s=arc-20160816; b=odKxz8KsZcQywtkIgK+Ws/4/AJwB9WDiPTOljaIUCfHMUc2EMR1yYUq5p/BgAAp32h JMxDzCkyy0dH11vMtRj/5JwUMVFQwjGwVmyn6muY8H+lPSROpQ5VTRfm8gagi3s1s1kW AE+xti0ue0eWCjqKlZAy2qo5JMAdCjq+DYwFbXwFSILOqzGiYg5HQAM2Bgu+pHCiD+wS zZwcuNxly6XaJ/zWVUPYLK4WHNRNayIqNL+Iv310zw4NpQ0+s9NklvuHpHtvZSvcfaPC LeHopttRCZXB3ptAGnaIeoSOkN8c8SGuPNtrk7qrmck8z39lBUYNheSlqR/tOMorK/zI 1pPA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=9UzygQjTYe7WxgjSlLaSTpE6e1CA2K3RuI2ScLnVNPk=; fh=+HdF1SWcNPggmowVZtzfZ2+SYSXLLgvZBECjaw6UQek=; b=jybdW+sfnEQx/+0zNCPBaiJ4YmcI61uVZK21VsFPJ5wN8ftrEo1nbhXsiX+PHEoiKn ou4kEk3KPg8FRLUpQfXebsvMnnWaHs7wI2ul+VAHpgGNB31PHIm1vYk1bb1pV4Kw4MUn TmMUz5kI7+S8mVmA0bbHqnmo/bqoJDtlfsijl81r+n3D/unmzGkj2rVDkArrxJ8duypR 5wKJFt6Rf2TMmp1tjG/GAYaZjiOQhPtJf00fPPqS1hLBAMDsjSZnVLMlGc3Qs6BLt7r1 fXIwLnn7XQaOZp4K5CyCN9QrjPSwjvf1ZIaEbDMrldHJzCaWaih6AqWpsSJlSB9zPMxN E5vg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uWCcugnu; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-3656-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3656-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c4a75e605asi561669a91.2.2024.06.11.20.08.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 20:08:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3656-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uWCcugnu; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-3656-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3656-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 475A1B21E99 for ; Wed, 12 Jun 2024 03:07:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C43A617BB9; Wed, 12 Jun 2024 03:07:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uWCcugnu" X-Original-To: linux-nfs@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A03FA1799B for ; Wed, 12 Jun 2024 03:07:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718161674; cv=none; b=fO4Q01dY9cjiEdQpbxtEgDGMkkP5Ot9ONeuG0Hq0pU20LttqTCiRRIs7N0VctniY0uVDscbRKwVlJXRIUXfkx3q96dxLY7oL3hq+UgyDf4iB0Rk8V9zmYY7SAS3JQvNnrrlBuCQLBgBks3psktmWm7JsmYEr3/U4hsKkdweKm7I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718161674; c=relaxed/simple; bh=jXhnViIe7fzMZvQsFuF6K9Ax83b2+vjS+Tc2uXM0Fx8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=u/f1sd6Xb4fXaPE91VumeSmWaihXsCNJdObvcwJu7/gdIeMo1x80RjchImQbxv4kKs08LPYnu9+68WS2F9uBatRxTIHEYRuBVl/2sgcpn9/MBZC9gUzNN0ZkjCPJGXDpyY8IE3RV5uIBxHlroiGO1q1X82/N+bnrLlgOf6sCBYA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uWCcugnu; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CEB9EC2BD10; Wed, 12 Jun 2024 03:07:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718161674; bh=jXhnViIe7fzMZvQsFuF6K9Ax83b2+vjS+Tc2uXM0Fx8=; h=From:To:Cc:Subject:Date:From; b=uWCcugnumeh5aOu5Z8hBkzWW5KNgjVAzsFqb2Sg0vk2pisy8q2/mlVNApbfJH2OsD YeCCVUlQ0mmfmUOyd0QG9n8fPRypSpbwScVZ1d5NW0faAmhpgWNFhxNBTYWMgKIUvm 1FjOp3XL14165T5emgW8dpIpDCeaOi0J4gYZEPvrfsghnGawPWr0IrRXp76d4xvujl zJvh9mHE8asl42ZdJCP5/mwVm19qGIy5WmiB/GanocIbNhQIUC8lJzFq4DhoTrC2Om FQQj08S4fLgCX4fi89axgnNviObZvTppxiONLvaFukp6aC9UcqYKGu0ivHxrwikVs0 hf5jp1jy1J8Fg== From: Mike Snitzer To: linux-nfs@vger.kernel.org Cc: Jeff Layton , Chuck Lever , Trond Myklebust , NeilBrown , snitzer@hammerspace.com Subject: [RFC PATCH v2 00/15] nfs/nfsd: add support for localio Date: Tue, 11 Jun 2024 23:07:37 -0400 Message-ID: <20240612030752.31754-1-snitzer@kernel.org> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi, This patch series rebases "localio" changes that Hammerspace (and Primary Data before it) has been carrying since 2014. The reason they weren't proposed for upstream inclusion until now was the handshake for whether or not a client and server are local was brittle, for more context please see this commit from v1: https://git.kernel.org/pub/scm/linux/kernel/git/snitzer/linux.git/commit/?h=nfs-localio-for-6.11.v1&id=8069f78e10f8fa4dd6aa6ba3ad643de6f95be6f6 Aside from rebasing the original changes from a 5.15.130-stable kernel, my contribution to this series started with making the localio handshake more robust. To do so a new LOCALIO protocol extension has been added to both NFS v3 and v4. It follows the well-worn pattern established by the ACL protocol extension. These changes have proven stable against various test scenarios: 1) client and server both on localhost (for both v3 and v4.2) 2) various permutations of client and server support enablement for both local and remote client and server. 3) client on host, server within a container (for both v3 and v4.2) My container testing was in terms of podman managed containers. That said, v2 is "RFC" because it still lacks proper refcounting on nn->nfsd_serv and I need help on how others would like to see that happen given svc_get/svc_put were removed with commit 1e3577a4521e ("SUNRPC: discard sv_refcnt, and svc_get/svc_put"). * Changes since v1: lots of folding and rebasing of patches to try to minimize needless preservation of old code that later patches removed. Dropped patches that weren't needed. Some renames and comments. Some refactoring of nfsiod_start. All review and comments are welcome! Thanks, Mike Mike Snitzer (6): nfs_common: add NFS LOCALIO protocol extension enablement nfs: implement v3 and v4 client support for NFS_LOCALIO_PROGRAM nfsd: implement v3 and v4 server support for NFS_LOCALIO_PROGRAM nfs/nfsd: consolidate {encode,decode}_opaque_fixed in nfs_xdr.h nfs/localio: move managing nfsd_open_local_fh symbol to nfs_common nfs/nfsd: ensure localio server always uses its network namespace Peng Tao (1): nfs: move nfs_stat_to_errno to nfs.h Trond Myklebust (3): NFS: for localio don't call filesystem read() and write() routines directly NFS: Enable localio for non-pNFS I/O pnfs/flexfiles: Enable localio for flexfiles I/O Weston Andros Adamson (5): nfs: pass nfs_client to nfs_initiate_pgio nfs: pass descriptor thru nfs_initiate_pgio path nfs: pass struct file to nfs_init_pgio and nfs_init_commit sunrpc: add rpcauth_map_to_svc_cred_local nfs/nfsd: add "localio" support fs/Kconfig | 3 + fs/nfs/Kconfig | 25 + fs/nfs/Makefile | 2 + fs/nfs/blocklayout/blocklayout.c | 6 +- fs/nfs/client.c | 17 +- fs/nfs/filelayout/filelayout.c | 16 +- fs/nfs/flexfilelayout/flexfilelayout.c | 131 +++- fs/nfs/flexfilelayout/flexfilelayout.h | 2 + fs/nfs/flexfilelayout/flexfilelayoutdev.c | 6 + fs/nfs/inode.c | 61 +- fs/nfs/internal.h | 96 ++- fs/nfs/localio.c | 830 ++++++++++++++++++++++ fs/nfs/nfs2xdr.c | 69 -- fs/nfs/nfs3_fs.h | 1 + fs/nfs/nfs3client.c | 25 + fs/nfs/nfs3proc.c | 3 + fs/nfs/nfs3xdr.c | 58 ++ fs/nfs/nfs4_fs.h | 2 + fs/nfs/nfs4client.c | 23 + fs/nfs/nfs4proc.c | 3 + fs/nfs/nfs4xdr.c | 65 +- fs/nfs/nfstrace.h | 61 ++ fs/nfs/pagelist.c | 32 +- fs/nfs/pnfs.c | 24 +- fs/nfs/pnfs.h | 6 +- fs/nfs/pnfs_nfs.c | 2 +- fs/nfs/write.c | 13 +- fs/nfs_common/Makefile | 3 + fs/nfs_common/nfslocalio.c | 71 ++ fs/nfsd/Kconfig | 25 + fs/nfsd/Makefile | 2 + fs/nfsd/filecache.c | 2 +- fs/nfsd/localio.c | 330 +++++++++ fs/nfsd/netns.h | 4 + fs/nfsd/nfsd.h | 11 + fs/nfsd/nfssvc.c | 93 ++- fs/nfsd/trace.h | 3 +- fs/nfsd/vfs.h | 9 + fs/nfsd/xdr.h | 6 + include/linux/nfs.h | 65 ++ include/linux/nfs_fs.h | 2 + include/linux/nfs_fs_sb.h | 9 + include/linux/nfs_xdr.h | 31 +- include/linux/nfslocalio.h | 39 + include/linux/sunrpc/auth.h | 4 + include/uapi/linux/nfs.h | 4 + net/sunrpc/auth.c | 17 + 47 files changed, 2146 insertions(+), 166 deletions(-) create mode 100644 fs/nfs/localio.c create mode 100644 fs/nfs_common/nfslocalio.c create mode 100644 fs/nfsd/localio.c create mode 100644 include/linux/nfslocalio.h -- 2.44.0