An error occurred fetching the project authors.
- 26 Sep, 2022 2 commits
-
-
Chuck Lever authored
Fix a typo. Reviewed-by:
Jeff Layton <jlayton@kernel.org> Signed-off-by:
Chuck Lever <chuck.lever@oracle.com>
-
Chuck Lever authored
The dust has settled a bit and it's become obvious what code is totally common between nfsd_init_dirlist_pages() and nfsd3_init_dirlist_pages(). Move that common code to SUNRPC. The new helper brackets the existing xdr_init_decode_pages() API. Signed-off-by:
Chuck Lever <chuck.lever@oracle.com>
-
- 23 Jul, 2022 4 commits
-
-
Anna Schumaker authored
These functions are no longer needed now that the NFS client places data and hole segments directly. Signed-off-by:
Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by:
Trond Myklebust <trond.myklebust@hammerspace.com>
-
Anna Schumaker authored
This will be used during READ_PLUS decoding for handling HOLE segments. Signed-off-by:
Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by:
Trond Myklebust <trond.myklebust@hammerspace.com>
-
Anna Schumaker authored
We need to do this step during READ_PLUS decoding so that we know pages are the right length and any extra data has been preserved in the tail. Signed-off-by:
Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by:
Trond Myklebust <trond.myklebust@hammerspace.com>
-
Anna Schumaker authored
I do this by creating an xdr subsegment for the range we will be operating over. This lets me shift data to the correct place without potentially overwriting anything already there. Signed-off-by:
Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by:
Trond Myklebust <trond.myklebust@hammerspace.com>
-
- 30 Jun, 2022 1 commit
-
-
Chuck Lever authored
Looks like there are still cases when "space_left - frag1bytes" can legitimately exceed PAGE_SIZE. Ensure that xdr->end always remains within the current encode buffer. Reported-by:
Bruce Fields <bfields@fieldses.org> Reported-by:
Zorro Lang <zlang@redhat.com> Link: https://bugzilla.kernel.org/show_bug.cgi?id=216151 Fixes: 6c254bf3 ("SUNRPC: Fix the calculation of xdr->end in xdr_get_next_encode_buffer()") Signed-off-by:
Chuck Lever <chuck.lever@oracle.com>
-
- 08 Jun, 2022 5 commits
-
-
Chuck Lever authored
To make the code easier to read, remove visual clutter by changing the declared type of @p. Signed-off-by:
Chuck Lever <chuck.lever@oracle.com> Reviewed-by:
NeilBrown <neilb@suse.de> Reviewed-by:
J. Bruce Fields <bfields@fieldses.org>
-
Chuck Lever authored
The value of @p is not used until the "location of the next item" is computed. Help human readers by moving its initial assignment to the paragraph where that value is used and by clarifying the antecedents in the documenting comment. Signed-off-by:
Chuck Lever <chuck.lever@oracle.com> Reviewed-by:
NeilBrown <neilb@suse.com> Reviewed-by:
J. Bruce Fields <bfields@fieldses.org>
-
Chuck Lever authored
Both the kvec::iov_len field and the third parameter of memcpy() and memmove() are size_t. There's no reason for the implicit conversion from size_t to int and back. Change the type of @shift to make the code easier to read and understand. Signed-off-by:
Chuck Lever <chuck.lever@oracle.com> Reviewed-by:
NeilBrown <neilb@suse.de> Reviewed-by:
J. Bruce Fields <bfields@fieldses.org>
-
Chuck Lever authored
Transitioning between encode buffers is quite infrequent. It happens about 1 time in 400 calls to xdr_reserve_space(), measured on NFSD with a typical build/test workload. Force the compiler to remove that code from xdr_reserve_space(), which is a hot path on both the server and the client. This change reduces the size of xdr_reserve_space() from 10 cache lines to 2 when compiled with -Os. Signed-off-by:
Chuck Lever <chuck.lever@oracle.com> Reviewed-by:
J. Bruce Fields <bfields@fieldses.org>
-
Chuck Lever authored
I found that NFSD's new NFSv3 READDIRPLUS XDR encoder was screwing up right at the end of the page array. xdr_get_next_encode_buffer() does not compute the value of xdr->end correctly: * The check to see if we're on the final available page in xdr->buf needs to account for the space consumed by @nbytes. * The new xdr->end value needs to account for the portion of @nbytes that is to be encoded into the previous buffer. Fixes: 2825a7f9 ("nfsd4: allow encoding across page boundaries") Signed-off-by:
Chuck Lever <chuck.lever@oracle.com> Reviewed-by:
NeilBrown <neilb@suse.de> Reviewed-by:
J. Bruce Fields <bfields@fieldses.org>
-
- 02 Oct, 2021 1 commit
-
-
Chuck Lever authored
xdr_stream_subsegment() was introduced in commit c1346a12 ("NFSD: Replace the internals of the READ_BUF() macro"). There are two call sites for xdr_stream_subsegment(). One is nfsd4_decode_write(), and the other is nfsd4_decode_setxattr(). Currently neither of these call sites calls this API when xdr_buf::page_base is a non-zero value. However, I'm about to add a case where page_base will sometimes not be zero when nfsd4_decode_write() invokes this API. Replace the logic in xdr_stream_subsegment() that advances to the next data item in the xdr_stream with something more generic in order to handle this new use case. Signed-off-by:
Chuck Lever <chuck.lever@oracle.com> Signed-off-by:
J. Bruce Fields <bfields@redhat.com>
-
- 13 Jun, 2021 1 commit
-
-
Anna Schumaker authored
This seems to happen fairly easily during READ_PLUS testing on NFS v4.2. I found that we could end up accessing xdr->buf->pages[pgnr] with a pgnr greater than the number of pages in the array. So let's just return early if we're setting base to a point at the end of the page data and let xdr_set_tail_base() handle setting up the buffer pointers instead. Signed-off-by:
Anna Schumaker <Anna.Schumaker@Netapp.com> Fixes: 8d86e373 ("SUNRPC: Clean up helpers xdr_set_iov() and xdr_set_page_base()") Signed-off-by:
Trond Myklebust <trond.myklebust@hammerspace.com>
-
- 14 Dec, 2020 8 commits
-
-
Trond Myklebust authored
If we're shifting the page data to the right, and this happens to be a sparse page array, then we may need to allocate new pages in order to receive the data. Reported-by:
"Mkrtchyan, Tigran" <tigran.mkrtchyan@desy.de> Signed-off-by:
Trond Myklebust <trond.myklebust@hammerspace.com>
-
Trond Myklebust authored
There are a number of xdr helpers for struct xdr_buf that do not change the structure itself. Mark those as taking const pointers for documentation purposes. Signed-off-by:
Trond Myklebust <trond.myklebust@hammerspace.com>
-
Trond Myklebust authored
Move the setting of the xdr_stream 'nwords' field into the helpers that reset the xdr_stream cursor. Signed-off-by:
Trond Myklebust <trond.myklebust@hammerspace.com>
-
Trond Myklebust authored
Clean up callers of _copy_to/from_pages() that still check for a zero length. Signed-off-by:
Trond Myklebust <trond.myklebust@hammerspace.com>
-
Trond Myklebust authored
Clean up xdr_shrink_bufhead() to use the new helpers instead of doing its own thing. Signed-off-by:
Trond Myklebust <trond.myklebust@hammerspace.com>
-
Trond Myklebust authored
We do want to try to grow the buffer if possible, but if that attempt fails, we still want to move the data and truncate the XDR message. Signed-off-by:
Trond Myklebust <trond.myklebust@hammerspace.com>
-
Trond Myklebust authored
The main use case right now for xdr_align_data() is to shift the page data to the left, and in practice shrink the total XDR data buffer. This patch ensures that we fix up the accounting for the buffer length as we shift that data around. Signed-off-by:
Trond Myklebust <trond.myklebust@hammerspace.com>
-
Trond Myklebust authored
Exit early if the shift is zero. Signed-off-by:
Trond Myklebust <trond.myklebust@hammerspace.com>
-
- 02 Dec, 2020 7 commits
-
-
Trond Myklebust authored
Signed-off-by:
Trond Myklebust <trond.myklebust@hammerspace.com>
-
Trond Myklebust authored
While we always want to align to the next page and/or the beginning of the tail buffer when we call xdr_set_next_page(), the functions xdr_align_data() and xdr_expand_hole() really want to align to the next object in that next page or tail. Signed-off-by:
Trond Myklebust <trond.myklebust@hammerspace.com>
-
Trond Myklebust authored
rpc_prepare_reply_pages() currently expects the 'hdrsize' argument to contain the length of the data that we expect to want placed in the head kvec plus a count of 1 word of padding that is placed after the page data. This is very confusing when trying to read the code, and sometimes leads to callers adding an arbitrary value of '1' just in order to satisfy the requirement (whether or not the page data actually needs such padding). This patch aims to clarify the code by changing the 'hdrsize' argument to remove that 1 word of padding. This means we need to subtract the padding from all the existing callers. Fixes: 02ef04e4 ("NFS: Account for XDR pad of buf->pages") Signed-off-by:
Trond Myklebust <trond.myklebust@hammerspace.com>
-
Trond Myklebust authored
Fix up xdr_read_pages() so that it can handle object lengths that are larger than the page length, by simply aligning to the next object in the buffer tail. The function will continue to return the length of the truncate object data that actually fit into the pages. Signed-off-by:
Trond Myklebust <trond.myklebust@hammerspace.com>
-
Trond Myklebust authored
Allow xdr_set_iov() to set a base so that we can use it to set the cursor to a specific position in the kvec buffer. If the new base overflows the kvec/pages buffer in either xdr_set_iov() or xdr_set_page_base(), then truncate it so that we point to the end of the buffer. Finally, change both function to return the number of bytes remaining to read in their buffers. Signed-off-by:
Trond Myklebust <trond.myklebust@hammerspace.com>
-
Trond Myklebust authored
We already know that the head buffer and page are empty, so if there is any data, it is in the tail. Signed-off-by:
Trond Myklebust <trond.myklebust@hammerspace.com>
-
Trond Myklebust authored
Signed-off-by:
Trond Myklebust <trond.myklebust@hammerspace.com>
-
- 30 Nov, 2020 3 commits
-
-
Chuck Lever authored
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>
-
Chuck Lever authored
Clean up: De-duplicate some frequently-used code. Signed-off-by:
Chuck Lever <chuck.lever@oracle.com>
-
Chuck Lever authored
Clean up: This enables xdr_buf_subsegment()'s callers to pass in a const pointer to that buffer. Signed-off-by:
Chuck Lever <chuck.lever@oracle.com>
-
- 07 Oct, 2020 6 commits
-
-
Anna Schumaker authored
For now, this function simply aligns the data at the beginning of the pages. This can eventually be expanded to shift data to the correct offsets when we're ready. Signed-off-by:
Anna Schumaker <Anna.Schumaker@Netapp.com>
-
Anna Schumaker authored
This patch adds the ability to "read a hole" into a set of XDR data pages by taking the following steps: 1) Shift all data after the current xdr->p to the right, possibly into the tail, 2) Zero the specified range, and 3) Update xdr->p to point beyond the hole. Signed-off-by:
Anna Schumaker <Anna.Schumaker@Netapp.com>
-
Anna Schumaker authored
xdr_shrink_pagelen() is very similar to what we need for hole expansion, so split out the common code into its own function that can be used by both functions. Signed-off-by:
Anna Schumaker <Anna.Schumaker@Netapp.com>
-
Anna Schumaker authored
I don't need the entire align pages code for READ_PLUS, so split out the part I do need so I don't need to reimplement anything. Signed-off-by:
Anna Schumaker <Anna.Schumaker@Netapp.com>
-
Anna Schumaker authored
I'll need this for READ_PLUS to help figure out the offset where page data is stored at, but it might also be useful for other things. Signed-off-by:
Anna Schumaker <Anna.Schumaker@Netapp.com>
-
Anna Schumaker authored
I'm going to need this bit of code in a few places for READ_PLUS decoding, so let's make it a helper function. Signed-off-by:
Anna Schumaker <Anna.Schumaker@Netapp.com>
-
- 25 Sep, 2020 2 commits
-
-
Anna Schumaker authored
Reserving space for a large READ payload requires special handling when reserving space in the xdr buffer pages. One problem we can have is use of the scratch buffer, which is used to get a pointer to a contiguous region of data up to PAGE_SIZE. When using the scratch buffer, calls to xdr_commit_encode() shift the data to it's proper alignment in the xdr buffer. If we've reserved several pages in a vector, then this could potentially invalidate earlier pointers and result in incorrect READ data being sent to the client. I get around this by looking at the amount of space left in the current page, and never reserve more than that for each entry in the read vector. This lets us place data directly where it needs to go in the buffer pages. Signed-off-by:
Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by:
J. Bruce Fields <bfields@redhat.com>
-
Randy Dunlap authored
Drop duplicate words in net/sunrpc/. Also fix "Anyone" to be "Any one". Signed-off-by:
Randy Dunlap <rdunlap@infradead.org> Cc: "J. Bruce Fields" <bfields@fieldses.org> Cc: Chuck Lever <chuck.lever@oracle.com> Cc: linux-nfs@vger.kernel.org Signed-off-by:
J. Bruce Fields <bfields@redhat.com>
-