summaryrefslogtreecommitdiff
path: root/fs
AgeCommit message (Collapse)Author
2020-11-30NFSD: Replace READ* macros in nfsd4_decode_secinfo()Chuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros in nfsd4_decode_renew()Chuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros in nfsd4_decode_rename()Chuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros in nfsd4_decode_remove()Chuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros in nfsd4_decode_readdir()Chuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros in nfsd4_decode_read()Chuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros in nfsd4_decode_putfh()Chuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros in nfsd4_decode_open_downgrade()Chuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros in nfsd4_decode_open_confirm()Chuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros in nfsd4_decode_open()Chuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Add helper to decode OPEN's open_claim4 argumentChuck Lever
Refactor for clarity. Note that op_fname is the only instance of an NFSv4 filename stored in a struct xdr_netobj. Convert it to a u32/char * pair so that the new nfsd4_decode_filename() helper can be used. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros in nfsd4_decode_share_deny()Chuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros in nfsd4_decode_share_access()Chuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Add helper to decode OPEN's openflag4 argumentChuck Lever
Refactor for clarity. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Add helper to decode OPEN's createhow4 argumentChuck Lever
Refactor for clarity. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Add helper to decode NFSv4 verifiersChuck Lever
This helper will be used to simplify decoders in subsequent patches. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros in nfsd4_decode_lookup()Chuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros in nfsd4_decode_locku()Chuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros in nfsd4_decode_lockt()Chuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros in nfsd4_decode_lock()Chuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Add helper for decoding locker4Chuck Lever
Refactor for clarity. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Add helpers to decode a clientid4 and an NFSv4 state ownerChuck Lever
These helpers will also be used to simplify decoders in subsequent patches. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Relocate nfsd4_decode_opaque()Chuck Lever
Enable nfsd4_decode_opaque() to be used in more decoders, and replace the READ* macros in nfsd4_decode_opaque(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30 NFSD: Replace READ* macros in nfsd4_decode_link()Chuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros in nfsd4_decode_getattr()Chuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros in nfsd4_decode_delegreturn()Chuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros in nfsd4_decode_create()Chuck Lever
A dedicated decoder for component4 is introduced here, which will be used by other operation decoders in subsequent patches. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros in nfsd4_decode_fattr()Chuck Lever
Let's be more careful to avoid overrunning the memory that backs the bitmap array. This requires updating the synopsis of nfsd4_decode_fattr(). Bruce points out that a server needs to be careful to return nfs_ok when a client presents bitmap bits the server doesn't support. This includes bits in bitmap words the server might not yet support. The current READ* based implementation is good about that, but that requirement hasn't been documented. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros that decode the fattr4 umask attributeChuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros that decode the fattr4 security label attributeChuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros that decode the fattr4 time_set attributesChuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros that decode the fattr4 owner_group attributeChuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros that decode the fattr4 owner attributeChuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros that decode the fattr4 mode attributeChuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros that decode the fattr4 acl attributeChuck Lever
Refactor for clarity and to move infrequently-used code out of line. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros that decode the fattr4 size attributeChuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Change the way the expected length of a fattr4 is checkedChuck Lever
Because the fattr4 is now managed in an xdr_stream, all that is needed is to store the initial position of the stream before decoding the attribute list. Then the actual length of the list is computed using the final stream position, after decoding is complete. No behavior change is expected. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros in nfsd4_decode_commit()Chuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros in nfsd4_decode_close()Chuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace READ* macros in nfsd4_decode_access()Chuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Replace the internals of the READ_BUF() macroChuck Lever
Convert the READ_BUF macro in nfs4xdr.c from open code to instead use the new xdr_stream-style decoders already in use by the encode side (and by the in-kernel NFS client implementation). Once this conversion is done, each individual NFSv4 argument decoder can be independently cleaned up to replace these macros with C code. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Add tracepoints in nfsd4_decode/encode_compound()Chuck Lever
For troubleshooting purposes, record failures to decode NFSv4 operation arguments and encode operation results. trace_nfsd_compound_decode_err() replaces the dprintk() call sites that are embedded in READ_* macros that are about to be removed. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Add tracepoints in nfsd_dispatch()Chuck Lever
For troubleshooting purposes, record GARBAGE_ARGS and CANT_ENCODE failures. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Add common helpers to decode void args and encode void resultsChuck Lever
Start off the conversion to xdr_stream by de-duplicating the functions that decode void arguments and encode void results. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30SUNRPC: Prepare for xdr_stream-style decoding on the server-sideChuck Lever
A "permanent" struct xdr_stream is allocated in struct svc_rqst so that it is usable by all server-side decoders. A per-rqst scratch buffer is also allocated to handle decoding XDR data items that cross page boundaries. To demonstrate how it will be used, add the first call site for the new svcxdr_init_decode() API. As an additional part of the overall conversion, add symbolic constants for successful and failed XDR operations. Returning "0" is overloaded. Sometimes it means something failed, but sometimes it means success. To make it more clear when XDR decoding functions succeed or fail, introduce symbolic constants. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30SUNRPC: Add xdr_set_scratch_page() and xdr_reset_scratch_buffer()Chuck Lever
Clean up: De-duplicate some frequently-used code. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30nfsd: Fix error return code in nfsd_file_cache_init()Huang Guobin
Fix to return PTR_ERR() error code from the error handling case instead of 0 in function nfsd_file_cache_init(), as done elsewhere in this function. Fixes: 65294c1f2c5e7("nfsd: add a new struct file caching facility to nfsd") Signed-off-by: Huang Guobin <huangguobin4@huawei.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30io_uring: fix recvmsg setup with compat buf-selectPavel Begunkov
__io_compat_recvmsg_copy_hdr() with REQ_F_BUFFER_SELECT reads out iov len but never assigns it to iov/fast_iov, leaving sr->len with garbage. Hopefully, following io_buffer_select() truncates it to the selected buffer size, but the value is still may be under what was specified. Cc: <stable@vger.kernel.org> # 5.7 Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-11-30NFSD: Add SPDX header for fs/nfsd/trace.cChuck Lever
Clean up. The file was contributed in 2014 by Christoph Hellwig in commit 31ef83dc0538 ("nfsd: add trace events"). Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2020-11-30NFSD: Remove extra "0x" in tracepoint format specifierChuck Lever
Clean up: %p adds its own 0x already. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>