Commit graph

3453 commits

Author SHA1 Message Date
Chuck Lever
2f31aa3e49 NFSD: Update the NFSv3 CREATE family of encoders to use struct xdr_stream
[ Upstream commit 78315b36781d259dcbdc102ff22c3f2f25712223 ]

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:33 +01:00
Chuck Lever
071f3e7c61 NFSD: Update the NFSv3 WRITE3res encoder to use struct xdr_stream
[ Upstream commit ecb7a085ac15a8844ebf12fca6ae51ce71ac9b3b ]

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:33 +01:00
Chuck Lever
5a2a508148 NFSD: Update the NFSv3 READ3res encode to use struct xdr_stream
[ Upstream commit cc9bcdad7773c295375e66c892c7ac00524706f2 ]

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:33 +01:00
Chuck Lever
73f907895f NFSD: Update the NFSv3 READLINK3res encoder to use struct xdr_stream
[ Upstream commit 9a9c8923b3efd593d0e6a405efef9d58c6e6804b ]

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:33 +01:00
Chuck Lever
5b10023828 NFSD: Update the NFSv3 wccstat result encoder to use struct xdr_stream
[ Upstream commit 70f8e839859a994e324e1d18889f8319bbd5bff9 ]

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:33 +01:00
Chuck Lever
68eefaa8dd NFSD: Update the NFSv3 LOOKUP3res encoder to use struct xdr_stream
[ Upstream commit 5cf353354af1a385f29dec4609a1532d32c83a25 ]

Also, clean up: Rename the encoder function to match the name of
the result structure in RFC 1813, consistent with other encoder
function names in nfs3xdr.c. "diropres" is an NFSv2 thingie.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:33 +01:00
Chuck Lever
ed2796887b NFSD: Update the NFSv3 ACCESS3res encoder to use struct xdr_stream
[ Upstream commit 907c38227fb57f5c537491ca76dd0b9636029393 ]

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:33 +01:00
Chuck Lever
36318a0ed9 NFSD: Update the GETATTR3res encoder to use struct xdr_stream
[ Upstream commit 2c42f804d30f6a8d86665eca84071b316821ea08 ]

As an additional clean up, some renaming is done to more closely
reflect the data type and variable names used in the NFSv3 XDR
definition provided in RFC 1813. "attrstat" is an NFSv2 thingie.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:33 +01:00
Chuck Lever
3db89fe0db NFSD: Extract the svcxdr_init_encode() helper
[ Upstream commit bddfdbcddbe267519cd36aeb115fdf8620980111 ]

NFSD initializes an encode xdr_stream only after the RPC layer has
already inserted the RPC Reply header. Thus it behaves differently
than xdr_init_encode does, which assumes the passed-in xdr_buf is
entirely devoid of content.

nfs4proc.c has this server-side stream initialization helper, but
it is visible only to the NFSv4 code. Move this helper to a place
that can be accessed by NFSv2 and NFSv3 server XDR functions.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:33 +01:00
Christian Brauner
01eed6c908 namei: introduce struct renamedata
[ Upstream commit 9fe61450972d3900bffb1dc26a17ebb9cdd92db2 ]

In order to handle idmapped mounts we will extend the vfs rename helper
to take two new arguments in follow up patches. Since this operations
already takes a bunch of arguments add a simple struct renamedata and
make the current helper use it before we extend it.

Link: https://lore.kernel.org/r/20210121131959.646623-14-christian.brauner@ubuntu.com
Cc: Christoph Hellwig <hch@lst.de>
Cc: David Howells <dhowells@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Reviewed-by: Christoph Hellwig <hch@lst.de>
[ cel: backported to 5.10.y, prior to idmapped mounts ]
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:33 +01:00
Christian Brauner
ef696bd15f fs: add file and path permissions helpers
[ Upstream commit 02f92b3868a1b34ab98464e76b0e4e060474ba10 ]

Add two simple helpers to check permissions on a file and path
respectively and convert over some callers. It simplifies quite a few
codepaths and also reduces the churn in later patches quite a bit.
Christoph also correctly points out that this makes codepaths (e.g.
ioctls) way easier to follow that would otherwise have to do more
complex argument passing than necessary.

Link: https://lore.kernel.org/r/20210121131959.646623-4-christian.brauner@ubuntu.com
Cc: David Howells <dhowells@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Suggested-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: James Morris <jamorris@linux.microsoft.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:33 +01:00
Christoph Hellwig
accc3ce1ab kallsyms: only build {,module_}kallsyms_on_each_symbol when required
[ Upstream commit 3e3552056ab42f883d7723eeb42fed712b66bacf ]

kallsyms_on_each_symbol and module_kallsyms_on_each_symbol are only used
by the livepatching code, so don't build them if livepatching is not
enabled.

Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:33 +01:00
Christoph Hellwig
9f48646718 kallsyms: refactor {,module_}kallsyms_on_each_symbol
[ Upstream commit 013c1667cf78c1d847152f7116436d82dcab3db4 ]

Require an explicit call to module_kallsyms_on_each_symbol to look
for symbols in modules instead of the call from kallsyms_on_each_symbol,
and acquire module_mutex inside of module_kallsyms_on_each_symbol instead
of leaving that up to the caller.  Note that this slightly changes the
behavior for the livepatch code in that the symbols from vmlinux are not
iterated anymore if objname is set, but that actually is the desired
behavior in this case.

Reviewed-by: Petr Mladek <pmladek@suse.com>
Acked-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:32 +01:00
Christoph Hellwig
06ade59d61 module: use RCU to synchronize find_module
[ Upstream commit a006050575745ca2be25118b90f1c37f454ac542 ]

Allow for a RCU-sched critical section around find_module, following
the lower level find_module_all helper, and switch the two callers
outside of module.c to use such a RCU-sched critical section instead
of module_mutex.

Reviewed-by: Petr Mladek <pmladek@suse.com>
Acked-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:32 +01:00
Shakeel Butt
22520adf5e inotify, memcg: account inotify instances to kmemcg
[ Upstream commit ac7b79fd190b02e7151bc7d2b9da692f537657f3 ]

Currently the fs sysctl inotify/max_user_instances is used to limit the
number of inotify instances on the system. For systems running multiple
workloads, the per-user namespace sysctl max_inotify_instances can be
used to further partition inotify instances. However there is no easy
way to set a sensible system level max limit on inotify instances and
further partition it between the workloads. It is much easier to charge
the underlying resource (i.e. memory) behind the inotify instances to
the memcg of the workload and let their memory limits limit the number
of inotify instances they can create.

With inotify instances charged to memcg, the admin can simply set
max_user_instances to INT_MAX and let the memcg limits of the jobs limit
their inotify instances.

Link: https://lore.kernel.org/r/20201220044608.1258123-1-shakeelb@google.com
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Shakeel Butt <shakeelb@google.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:32 +01:00
J. Bruce Fields
3ecb34ecc2 nfsd: skip some unnecessary stats in the v4 case
[ Upstream commit 428a23d2bf0ca8fd4d364a464c3e468f0e81671e ]

In the typical case of v4 and an i_version-supporting filesystem, we can
skip a stat which is only required to fake up a change attribute from
ctime.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:32 +01:00
J. Bruce Fields
5666661a7e nfs: use change attribute for NFS re-exports
[ Upstream commit 3cc55f4434b421d37300aa9a167ace7d60b45ccf ]

When exporting NFS, we may as well use the real change attribute
returned by the original server instead of faking up a change attribute
from the ctime.

Note we can't do that by setting I_VERSION--that would also turn on the
logic in iversion.h which treats the lower bit specially, and that
doesn't make sense for NFS.

So instead we define a new export operation for filesystems like NFS
that want to manage the change attribute themselves.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:32 +01:00
Dai Ngo
d2004ab4e4 NFSv4_2: SSC helper should use its own config.
[ Upstream commit 02591f9febd5f69bb4c266a4abf899c4cf21964f ]

Currently NFSv4_2 SSC helper, nfs_ssc, incorrectly uses GRACE_PERIOD
as its config. Fix by adding new config NFS_V4_2_SSC_HELPER which
depends on NFS_V4_2 and is automatically selected when NFSD_V4 is
enabled. Also removed the file name from a comment in nfs_ssc.c.

Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:32 +01:00
J. Bruce Fields
15b557992b nfsd: cstate->session->se_client -> cstate->clp
[ Upstream commit ec59659b4972ec25851aa03b4b5baba6764a62e4 ]

I'm not sure why we're writing this out the hard way in so many places.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:32 +01:00
J. Bruce Fields
14808d5e8d nfsd: simplify nfsd4_check_open_reclaim
[ Upstream commit 1722b04624806ced51693f546edb83e8b2297a77 ]

The set_client() was already taken care of by process_open1().

The comments here are mostly redundant with the code.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:32 +01:00
J. Bruce Fields
9a25007674 nfsd: remove unused set_client argument
[ Upstream commit f71475ba8c2a77fff8051903cf4b7d826c3d1693 ]

Every caller is setting this argument to false, so we don't need it.

Also cut this comment a bit and remove an unnecessary warning.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:32 +01:00
J. Bruce Fields
30a20ecc1b nfsd: find_cpntf_state cleanup
[ Upstream commit 47fdb22dacae78f37701d82a94c16a014186d34e ]

I think this unusual use of struct compound_state could cause confusion.

It's not that much more complicated just to open-code this stateid
lookup.

The only change in behavior should be a different error return in the
case the copy is using a source stateid that is a revoked delegation,
but I doubt that matters.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
[ cel: squashed in fix reported by Coverity ]
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:31 +01:00
J. Bruce Fields
794841da84 nfsd: refactor set_client
[ Upstream commit 7950b5316e40d99dcb85ab81a2d1dbb913d7c1c8 ]

This'll be useful elsewhere.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:31 +01:00
J. Bruce Fields
5204719478 nfsd: rename lookup_clientid->set_client
[ Upstream commit 460d27091ae2c23e7ac959a61cd481c58832db58 ]

I think this is a better name, and I'm going to reuse elsewhere the code
that does the lookup itself.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:31 +01:00
J. Bruce Fields
01b03fcec1 nfsd: simplify nfsd_renew
[ Upstream commit b4587eb2cf4b6271f67fb93b75f7de2a2026e853 ]

You can take the single-exit thing too far, I think.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:31 +01:00
J. Bruce Fields
238fe9021e nfsd: simplify process_lock
[ Upstream commit a9d53a75cf574d6aa41f3cb4968fffe4f64e0fad ]

Similarly, this STALE_CLIENTID check is already handled by:

nfs4_preprocess_confirmed_seqid_op()->
        nfs4_preprocess_seqid_op()->
                nfsd4_lookup_stateid()->
                        set_client()->
                                STALE_CLIENTID()

(This may cause it to return a different error in some cases where
there are multiple things wrong; pynfs test SEQ10 regressed on this
commit because of that, but I think that's the test's fault, and I've
fixed it separately.)

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:31 +01:00
J. Bruce Fields
6820e79873 nfsd4: simplify process_lookup1
[ Upstream commit 33311873adb0d55c287b164117b5b4bb7b1bdc40 ]

This STALE_CLIENTID check is redundant with the one in
lookup_clientid().

There's a difference in behavior is in case of memory allocation
failure, which I think isn't a big deal.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:31 +01:00
Amir Goldstein
7a838bc26d nfsd: report per-export stats
[ Upstream commit 20ad856e47323e208ae8d6a9ecfe5bf0be6f505e ]

Collect some nfsd stats per export in addition to the global stats.

A new nfsdfs export_stats file is created.  It uses the same ops as the
exports file to iterate the export entries and we use the file's name to
determine the reported info per export.  For example:

 $ cat /proc/fs/nfsd/export_stats
 # Version 1.1
 # Path Client Start-time
 #	Stats
 /test	localhost	92
	fh_stale: 0
	io_read: 9
	io_write: 1

Every export entry reports the start time when stats collection
started, so stats collecting scripts can know if stats where reset
between samples.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:31 +01:00
Amir Goldstein
5cc928db9c nfsd: protect concurrent access to nfsd stats counters
[ Upstream commit e567b98ce9a4b35b63c364d24828a9e5cd7a8179 ]

nfsd stats counters can be updated by concurrent nfsd threads without any
protection.

Convert some nfsd_stats and nfsd_net struct members to use percpu counters.

The longest_chain* members of struct nfsd_net remain unprotected.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:31 +01:00
Amir Goldstein
a5d723972f nfsd: remove unused stats counters
[ Upstream commit 1b76d1df1a3683b6b23cd1c813d13c5e6a9d35e5 ]

Commit 501cb1849f86 ("nfsd: rip out the raparms cache") removed the
code that updates read-ahead cache stats counters,
commit 8bbfa9f3889b ("knfsd: remove the nfsd thread busy histogram")
removed code that updates the thread busy stats counters back in 2009
and code that updated filehandle cache stats was removed back in 2002.

Remove the unused stats counters from nfsd_stats struct and print
hardcoded zeros in /proc/net/rpc/nfsd.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:31 +01:00
Chuck Lever
3d34960ddb NFSD: Clean up after updating NFSv3 ACL decoders
[ Upstream commit 9cee763ee654ce8622d673b8e32687d738e24ace ]

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:31 +01:00
Chuck Lever
d7e39a626f NFSD: Update the NFSv2 SETACL argument decoder to use struct xdr_stream
[ Upstream commit 68519ff2a1c72c67fcdc4b81671acda59f420af9 ]

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:31 +01:00
Chuck Lever
367a75f550 NFSD: Update the NFSv3 GETACL argument decoder to use struct xdr_stream
[ Upstream commit 05027eafc266487c6e056d10ab352861df95b5d4 ]

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:31 +01:00
Chuck Lever
2da089d28a NFSD: Clean up after updating NFSv2 ACL decoders
[ Upstream commit baadce65d6ee3032b921d9c043ba808bc69d6b13 ]

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:31 +01:00
Chuck Lever
e95b18bb88 NFSD: Update the NFSv2 ACL ACCESS argument decoder to use struct xdr_stream
[ Upstream commit 64063892efc1daa3a48882673811ff327ba75ed5 ]

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:31 +01:00
Chuck Lever
76807230a1 NFSD: Update the NFSv2 ACL GETATTR argument decoder to use struct xdr_stream
[ Upstream commit 571d31f37a57729c9d3463b5a692a84e619b408a ]

Since the ACL GETATTR procedure is the same as the normal GETATTR
procedure, simply re-use nfssvc_decode_fhandleargs.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:31 +01:00
Chuck Lever
48125c9dfe NFSD: Update the NFSv2 SETACL argument decoder to use struct xdr_stream
[ Upstream commit 427eab3ba22891845265f9a3846de6ac152ec836 ]

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:31 +01:00
Chuck Lever
4a4df45412 NFSD: Add an xdr_stream-based decoder for NFSv2/3 ACLs
[ Upstream commit 6bb844b4eb6e3b109a2fdaffb60e6da722dc4356 ]

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:30 +01:00
Chuck Lever
67e87fecaa NFSD: Update the NFSv2 GETACL argument decoder to use struct xdr_stream
[ Upstream commit 635a45d34706400c59c3b18ca9fccba195147bda ]

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:30 +01:00
Chuck Lever
54fc934afd NFSD: Remove argument length checking in nfsd_dispatch()
[ Upstream commit 5650682e16f41722f735b7beeb2dbc3411dfbeb6 ]

Now that the argument decoders for NFSv2 and NFSv3 use the
xdr_stream mechanism, the version-specific length checking logic in
nfsd_dispatch() is no longer necessary.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:30 +01:00
Chuck Lever
fa60fdae82 NFSD: Update the NFSv2 SYMLINK argument decoder to use struct xdr_stream
[ Upstream commit 09f75a5375ac61f4adb94da0accc1cfc60eb4f2b ]

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:30 +01:00
Chuck Lever
6a9bde4e9f NFSD: Update the NFSv2 CREATE argument decoder to use struct xdr_stream
[ Upstream commit 7dcf65b91ecaf60ce593e7859ae2b29b7c46ccbd ]

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:30 +01:00
Chuck Lever
846c00e1da NFSD: Update the NFSv2 SETATTR argument decoder to use struct xdr_stream
[ Upstream commit 2fdd6bd293b9e7dda61220538b2759fbf06f5af0 ]

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:30 +01:00
Chuck Lever
42f9734887 NFSD: Update the NFSv2 LINK argument decoder to use struct xdr_stream
[ Upstream commit 77edcdf91f6245a9881b84e4e101738148bd039a ]

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:30 +01:00
Chuck Lever
600cb5c632 NFSD: Update the NFSv2 RENAME argument decoder to use struct xdr_stream
[ Upstream commit 62aa557efb81ea3339fabe7f5b1a343e742bbbdf ]

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:30 +01:00
Chuck Lever
3973346f7b NFSD: Update NFSv2 diropargs decoding to use struct xdr_stream
[ Upstream commit 6d742c1864c18f143ea2031f1ed66bcd8f4812de ]

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:30 +01:00
Chuck Lever
a157e4f21a NFSD: Update the NFSv2 READDIR argument decoder to use struct xdr_stream
[ Upstream commit 8688361ae2edb8f7e61d926dc5000c9a44f29370 ]

As an additional clean up, move code not related to XDR decoding
into readdir's .pc_func call out.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:30 +01:00
Chuck Lever
30d0fb860f NFSD: Add helper to set up the pages where the dirlist is encoded
[ Upstream commit 788cd46ecf83ee2d561cb4e754e276dc8089b787 ]

Add a helper similar to nfsd3_init_dirlist_pages().

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:30 +01:00
Chuck Lever
a6f42c646f NFSD: Update the NFSv2 READLINK argument decoder to use struct xdr_stream
[ Upstream commit 1fcbd1c9456ba129d38420e345e91c4b6363db47 ]

If the code that sets up the sink buffer for nfsd_readlink() is
moved adjacent to the nfsd_readlink() call site that uses it, then
the only argument is a file handle, and the fhandle decoder can be
used instead.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:30 +01:00
Chuck Lever
1aa33901b0 NFSD: Update the NFSv2 WRITE argument decoder to use struct xdr_stream
[ Upstream commit a51b5b737a0be93fae6ea2a18df03ab2359a3f4b ]

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:30 +01:00