#
93b8959a |
| 01-Nov-2020 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: More readdir cleanups
Remove the redundant caching of the credential in struct nfs_open_dir_context. Pass the buffer size as an argument to nfs_readdir_xdr_filler().
Signed-off-by: Trond Mykle
NFS: More readdir cleanups
Remove the redundant caching of the credential in struct nfs_open_dir_context. Pass the buffer size as an argument to nfs_readdir_xdr_filler().
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Reviewed-by: Benjamin Coddington <bcodding@redhat.com> Tested-by: Benjamin Coddington <bcodding@redhat.com> Tested-by: Dave Wysochanski <dwysocha@redhat.com>
show more ...
|
#
1a34c8c9 |
| 01-Nov-2020 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Support larger readdir buffers
Support readdir buffers of up to 1MB in size so that we can read large directories using few RPC calls.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspa
NFS: Support larger readdir buffers
Support readdir buffers of up to 1MB in size so that we can read large directories using few RPC calls.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Reviewed-by: Benjamin Coddington <bcodding@redhat.com> Tested-by: Benjamin Coddington <bcodding@redhat.com> Tested-by: Dave Wysochanski <dwysocha@redhat.com>
show more ...
|
#
a52a8a6a |
| 01-Nov-2020 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Simplify struct nfs_cache_array_entry
We don't need to store a hash, so replace struct qstr with a simple const char pointer and length.
Signed-off-by: Trond Myklebust <trond.myklebust@hammers
NFS: Simplify struct nfs_cache_array_entry
We don't need to store a hash, so replace struct qstr with a simple const char pointer and length.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Reviewed-by: Benjamin Coddington <bcodding@redhat.com> Tested-by: Benjamin Coddington <bcodding@redhat.com> Tested-by: Dave Wysochanski <dwysocha@redhat.com>
show more ...
|
#
ed09222d |
| 01-Nov-2020 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Replace kmap() with kmap_atomic() in nfs_readdir_search_array()
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Reviewed-by: Benjamin Coddington <bcodding@redhat.com> Tested-by
NFS: Replace kmap() with kmap_atomic() in nfs_readdir_search_array()
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Reviewed-by: Benjamin Coddington <bcodding@redhat.com> Tested-by: Benjamin Coddington <bcodding@redhat.com> Tested-by: Dave Wysochanski <dwysocha@redhat.com>
show more ...
|
#
e762a639 |
| 01-Nov-2020 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Remove unnecessary kmap in nfs_readdir_xdr_to_array()
The kmapped pointer is only used once per loop to check if we need to exit.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.co
NFS: Remove unnecessary kmap in nfs_readdir_xdr_to_array()
The kmapped pointer is only used once per loop to check if we need to exit.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Reviewed-by: Benjamin Coddington <bcodding@redhat.com> Tested-by: Benjamin Coddington <bcodding@redhat.com> Tested-by: Dave Wysochanski <dwysocha@redhat.com>
show more ...
|
#
3b2a09f1 |
| 01-Nov-2020 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Don't discard readdir results
If a readdir call returns more data than we can fit into one page cache page, then allocate a new one for that data rather than discarding the data.
Signed-off-by
NFS: Don't discard readdir results
If a readdir call returns more data than we can fit into one page cache page, then allocate a new one for that data rather than discarding the data.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Reviewed-by: Benjamin Coddington <bcodding@redhat.com> Tested-by: Benjamin Coddington <bcodding@redhat.com> Tested-by: Dave Wysochanski <dwysocha@redhat.com>
show more ...
|
#
1f1d4aa4 |
| 01-Nov-2020 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Clean up directory array handling
Refactor to use pagecache_get_page() so that we can fill the page in multiple stages.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Reviewe
NFS: Clean up directory array handling
Refactor to use pagecache_get_page() so that we can fill the page in multiple stages.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Reviewed-by: Benjamin Coddington <bcodding@redhat.com> Tested-by: Benjamin Coddington <bcodding@redhat.com> Tested-by: Dave Wysochanski <dwysocha@redhat.com>
show more ...
|
#
972bcdf2 |
| 01-Nov-2020 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Clean up nfs_readdir_page_filler()
Clean up handling of the case where there are no entries in the readdir reply.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Reviewed-by:
NFS: Clean up nfs_readdir_page_filler()
Clean up handling of the case where there are no entries in the readdir reply.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Reviewed-by: Benjamin Coddington <bcodding@redhat.com> Tested-by: Benjamin Coddington <bcodding@redhat.com> Tested-by: Dave Wysochanski <dwysocha@redhat.com>
show more ...
|
#
b1e21c97 |
| 01-Nov-2020 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Clean up readdir struct nfs_cache_array
Since the 'eof_index' is only ever used as a flag, make it so. Also add a flag to detect if the page has been completely filled.
Signed-off-by: Trond My
NFS: Clean up readdir struct nfs_cache_array
Since the 'eof_index' is only ever used as a flag, make it so. Also add a flag to detect if the page has been completely filled.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Reviewed-by: Benjamin Coddington <bcodding@redhat.com> Tested-by: Benjamin Coddington <bcodding@redhat.com> Tested-by: Dave Wysochanski <dwysocha@redhat.com>
show more ...
|
#
2e7a4641 |
| 01-Nov-2020 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Ensure contents of struct nfs_open_dir_context are consistent
Ensure that the contents of struct nfs_open_dir_context are consistent by setting them under the file->f_lock from a private copy (
NFS: Ensure contents of struct nfs_open_dir_context are consistent
Ensure that the contents of struct nfs_open_dir_context are consistent by setting them under the file->f_lock from a private copy (that is known to be consistent).
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Reviewed-by: Benjamin Coddington <bcodding@redhat.com> Tested-by: Benjamin Coddington <bcodding@redhat.com> Tested-by: Dave Wysochanski <dwysocha@redhat.com>
show more ...
|
#
0ae4c3e8 |
| 11-Nov-2020 |
Chuck Lever <chuck.lever@oracle.com> |
SUNRPC: Add xdr_set_scratch_page() and xdr_reset_scratch_buffer()
Clean up: De-duplicate some frequently-used code.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
|
#
e181960e |
| 08-Mar-2021 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Don't gratuitously clear the inode cache when lookup failed
[ Upstream commit 47397915ede0192235474b145ebcd81b37b03624 ]
The fact that the lookup revalidation failed, does not mean that the in
NFS: Don't gratuitously clear the inode cache when lookup failed
[ Upstream commit 47397915ede0192235474b145ebcd81b37b03624 ]
The fact that the lookup revalidation failed, does not mean that the inode contents have changed.
Fixes: 5ceb9d7fdaaf ("NFS: Refactor nfs_lookup_revalidate()") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
show more ...
|
#
dd756d05 |
| 08-Mar-2021 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Don't revalidate the directory permissions on a lookup failure
[ Upstream commit 82e7ca1334ab16e2e04fafded1cab9dfcdc11b40 ]
There should be no reason to expect the directory permissions to cha
NFS: Don't revalidate the directory permissions on a lookup failure
[ Upstream commit 82e7ca1334ab16e2e04fafded1cab9dfcdc11b40 ]
There should be no reason to expect the directory permissions to change just because the directory contents changed or a negative lookup timed out. So let's avoid doing a full call to nfs_mark_for_revalidate() in that case. Furthermore, if this is a negative dentry, and we haven't actually done a new lookup, then we have no reason yet to believe the directory has changed at all. So let's remove the gratuitous directory inode invalidation altogether when called from nfs_lookup_revalidate_negative().
Reported-by: Geert Jansen <gerardu@amazon.com> Fixes: 5ceb9d7fdaaf ("NFS: Refactor nfs_lookup_revalidate()") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
show more ...
|
#
11decaf8 |
| 30-Oct-2020 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Remove unnecessary inode lock in nfs_fsync_dir()
nfs_inc_stats() is already thread-safe, and there are no other reasons to hold the inode lock here.
Signed-off-by: Trond Myklebust <trond.mykle
NFS: Remove unnecessary inode lock in nfs_fsync_dir()
nfs_inc_stats() is already thread-safe, and there are no other reasons to hold the inode lock here.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
show more ...
|
#
83f2c45e |
| 30-Oct-2020 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Remove unnecessary inode locking in nfs_llseek_dir()
Remove the contentious inode lock, and instead provide thread safety using the file->f_lock spinlock.
Signed-off-by: Trond Myklebust <trond
NFS: Remove unnecessary inode locking in nfs_llseek_dir()
Remove the contentious inode lock, and instead provide thread safety using the file->f_lock spinlock.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
show more ...
|
Revision tags: v5.8.17, v5.8.16, v5.8.15, v5.9, v5.8.14, v5.8.13, v5.8.12, v5.8.11, v5.8.10 |
|
#
d33030e2 |
| 15-Sep-2020 |
Jeffrey Mitchell <jeffrey.mitchell@starlab.io> |
nfs: Fix security label length not being reset
nfs_readdir_page_filler() iterates over entries in a directory, reusing the same security label buffer, but does not reset the buffer's length. This ca
nfs: Fix security label length not being reset
nfs_readdir_page_filler() iterates over entries in a directory, reusing the same security label buffer, but does not reset the buffer's length. This causes decode_attr_security_label() to return -ERANGE if an entry's security label is longer than the previous one's. This error, in nfs4_decode_dirent(), only gets passed up as -EAGAIN, which causes another failed attempt to copy into the buffer. The second error is ignored and the remaining entries do not show up in ls, specifically the getdents64() syscall.
Reproduce by creating multiple files in NFS and giving one of the later files a longer security label. ls will not see that file nor any that are added afterwards, though they will exist on the backend.
In nfs_readdir_page_filler(), reset security label buffer length before every reuse
Signed-off-by: Jeffrey Mitchell <jeffrey.mitchell@starlab.io> Fixes: b4487b935452 ("nfs: Fix getxattr kernel panic and memory overflow") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
show more ...
|
Revision tags: v5.8.9, v5.8.8, v5.8.7, v5.8.6, v5.4.62, v5.8.5, v5.8.4, v5.4.61 |
|
#
df561f66 |
| 23-Aug-2020 |
Gustavo A. R. Silva <gustavoars@kernel.org> |
treewide: Use fallthrough pseudo-keyword
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through mar
treewide: Use fallthrough pseudo-keyword
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case.
[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
show more ...
|
Revision tags: v5.8.3, v5.4.60, v5.8.2, v5.4.59, v5.8.1, v5.4.58, v5.4.57, v5.4.56, v5.8, v5.7.12, v5.4.55, v5.7.11, v5.4.54, v5.7.10, v5.4.53, v5.4.52, v5.7.9, v5.7.8, v5.4.51, v5.4.50, v5.7.7, v5.4.49, v5.7.6 |
|
#
72832a24 |
| 23-Jun-2020 |
Frank van der Linden <fllinden@amazon.com> |
NFSv4.2: query the extended attribute access bits
RFC 8276 defines separate ACCESS bits for extended attribute checking. Query them in nfs_do_access and opendata.
Signed-off-by: Frank van der Linde
NFSv4.2: query the extended attribute access bits
RFC 8276 defines separate ACCESS bits for extended attribute checking. Query them in nfs_do_access and opendata.
Signed-off-by: Frank van der Linden <fllinden@amazon.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
show more ...
|
#
d2ae4f8b |
| 23-Jun-2020 |
Frank van der Linden <fllinden@amazon.com> |
nfs: define nfs_access_get_cached function
The only consumer of nfs_access_get_cached_rcu and nfs_access_cached calls these static functions in order to first try RCU access, and then locked access.
nfs: define nfs_access_get_cached function
The only consumer of nfs_access_get_cached_rcu and nfs_access_cached calls these static functions in order to first try RCU access, and then locked access.
Combine them in to a single function, and call that. Make this function available to the rest of the NFS code.
Signed-off-by: Frank van der Linden <fllinden@amazon.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
show more ...
|
Revision tags: v5.7.5, v5.4.48, v5.7.4, v5.7.3, v5.4.47, v5.4.46, v5.7.2, v5.4.45, v5.7.1, v5.4.44, v5.7, v5.4.43, v5.4.42, v5.4.41, v5.4.40, v5.4.39, v5.4.38, v5.4.37, v5.4.36, v5.4.35, v5.4.34, v5.4.33, v5.4.32, v5.4.31 |
|
#
93ce4af7 |
| 06-Apr-2020 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Clean up process of marking inode stale.
Instead of the various open coded calls to set the NFS_INO_STALE bit and call nfs_zap_caches(), consolidate them into a single function nfs_set_inode_st
NFS: Clean up process of marking inode stale.
Instead of the various open coded calls to set the NFS_INO_STALE bit and call nfs_zap_caches(), consolidate them into a single function nfs_set_inode_stale().
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
show more ...
|
Revision tags: v5.4.30, v5.4.29, v5.6, v5.4.28, v5.4.27, v5.4.26, v5.4.25 |
|
#
5601cda8 |
| 09-Mar-2020 |
Gustavo A. R. Silva <gustavo@embeddedor.com> |
nfs: Replace zero-length array with flexible-array member
The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare varia
nfs: Replace zero-length array with flexible-array member
The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99:
struct foo { int stuff; struct boo array[]; };
By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on.
Also, notice that, dynamic memory allocations won't be affected by this change:
"Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1]
This issue was found with the help of Coccinelle.
[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
show more ...
|
#
eb095c14 |
| 05-Mar-2020 |
Zhouyi Zhou <zhouzhouyi@gmail.com> |
NFS:remove redundant call to nfs_do_access
In function nfs_permission: 1. the rcu_read_lock and rcu_read_unlock around nfs_do_access is unnecessary because the rcu critical data structure is already
NFS:remove redundant call to nfs_do_access
In function nfs_permission: 1. the rcu_read_lock and rcu_read_unlock around nfs_do_access is unnecessary because the rcu critical data structure is already protected in subsidiary function nfs_access_get_cached_rcu. No other data structure needs rcu_read_lock in nfs_do_access.
2. call nfs_do_access once is enough, because: 2-1. when mask has MAY_NOT_BLOCK bit The second call to nfs_do_access will not happen.
2-2. when mask has no MAY_NOT_BLOCK bit The second call to nfs_do_access will happen if res == -ECHILD, which means the first nfs_do_access goes out after statement if (!may_block). The second call to nfs_do_access will go through this procedure once again except continue the work after if (!may_block). But above work can be performed by only one call to nfs_do_access without mangling the mask flag.
Tested in x86_64 Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
show more ...
|
Revision tags: v5.4.24, v5.4.23, v5.4.22, v5.4.21, v5.4.20, v5.4.19 |
|
#
a8b373ee |
| 08-Feb-2020 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Limit the size of the access cache by default
Currently, we have no real limit on the access cache size (we set it to ULONG_MAX). That can lead to credentials getting pinned for a very long tim
NFS: Limit the size of the access cache by default
Currently, we have no real limit on the access cache size (we set it to ULONG_MAX). That can lead to credentials getting pinned for a very long time on lots of files if you have a system with a lot of memory.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
show more ...
|
Revision tags: v5.4.18 |
|
#
59e356a9 |
| 03-Feb-2020 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Use the 64-bit server readdir cookies when possible
When we're running as a 64-bit architecture and are not running in 32-bit compatibility mode, it is better to use the 64-bit readdir cookies
NFS: Use the 64-bit server readdir cookies when possible
When we're running as a 64-bit architecture and are not running in 32-bit compatibility mode, it is better to use the 64-bit readdir cookies that supplied by the server. Doing so improves the accuracy of telldir()/seekdir(), particularly when the directory is changing, for instance, when doing 'rm -rf'.
We still fall back to using the 32-bit offsets on 32-bit architectures and when in compatibility mode.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
show more ...
|
Revision tags: v5.4.17, v5.4.16, v5.5, v5.4.15, v5.4.14, v5.4.13, v5.4.12, v5.4.11, v5.4.10, v5.4.9, v5.4.8, v5.4.7, v5.4.6, v5.4.5, v5.4.4, v5.4.3 |
|
#
9f01eb5d |
| 09-Dec-2019 |
Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com> |
nfs: Fix nfs_access_get_cached_rcu() sparse error
This patch fixes the following sparse error: fs/nfs/dir.c:2353:14: error: incompatible types in comparison expression (different address spaces): fs
nfs: Fix nfs_access_get_cached_rcu() sparse error
This patch fixes the following sparse error: fs/nfs/dir.c:2353:14: error: incompatible types in comparison expression (different address spaces): fs/nfs/dir.c:2353:14: struct list_head [noderef] <asn:4> * fs/nfs/dir.c:2353:14: struct list_head *
Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
show more ...
|