#
728dd0ab |
| 22-Feb-2022 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Don't re-read the entire page cache to find the next cookie
If the page cache entry that was last read gets invalidated for some reason, then make sure we can re-create it on the next call to r
NFS: Don't re-read the entire page cache to find the next cookie
If the page cache entry that was last read gets invalidated for some reason, then make sure we can re-create it on the next call to readdir. This, combined with the cache page validation, allows us to reuse the cached value of page-index on successive calls to nfs_readdir.
Credit is due to Benjamin Coddington for showing that the concept works, and that it allows for improved cache sharing between processes even in the case where pages are lost due to LRU or active invalidation.
Suggested-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
show more ...
|
#
d09e673f |
| 22-Feb-2022 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Store the change attribute in the directory page cache
Use the change attribute and the first cookie in a directory page cache entry to validate that the page is up to date.
Suggested-by: Benj
NFS: Store the change attribute in the directory page cache
Use the change attribute and the first cookie in a directory page cache entry to validate that the page is up to date.
Suggested-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
show more ...
|
#
0b2662b7 |
| 22-Feb-2022 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Calculate page offsets algorithmically
Instead of relying on counting the page offsets as we walk through the page cache, switch to calculating them algorithmically.
Signed-off-by: Trond Mykle
NFS: Calculate page offsets algorithmically
Instead of relying on counting the page offsets as we walk through the page cache, switch to calculating them algorithmically.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
show more ...
|
#
281f31b2 |
| 22-Feb-2022 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Use kzalloc() to avoid initialising the nfs_open_dir_context
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
#
d1e32ea3 |
| 25-Feb-2022 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Initialise the readdir verifier as best we can in nfs_opendir()
For the purpose of ensuring that opendir() followed by seekdir() work as correctly as possible, try to initialise the readdir ver
NFS: Initialise the readdir verifier as best we can in nfs_opendir()
For the purpose of ensuring that opendir() followed by seekdir() work as correctly as possible, try to initialise the readdir verifier in nfs_opendir().
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
show more ...
|
#
2eef8a31 |
| 19-Feb-2022 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Trace lookup revalidation failure
Enable tracing of lookup revalidation failures.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
#
84631f84 |
| 23-Feb-2022 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Clean up NFSv4.2 xattrs
Add a helper for the xattr mask so that we can get rid of the inlined ifdefs.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
Revision tags: v5.15.21, v5.15.20 |
|
#
43245eca |
| 02-Feb-2022 |
Olga Kornievskaia <kolga@netapp.com> |
NFSv4.1 support for NFS4_RESULT_PRESERVER_UNLINKED
In 4.1+, the server is allowed to set a flag NFS4_RESULT_PRESERVE_UNLINKED in reply to the OPEN, that tells the client that it does not need to do
NFSv4.1 support for NFS4_RESULT_PRESERVER_UNLINKED
In 4.1+, the server is allowed to set a flag NFS4_RESULT_PRESERVE_UNLINKED in reply to the OPEN, that tells the client that it does not need to do a silly rename of an opened file when it's being removed.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
show more ...
|
Revision tags: v5.15.19 |
|
#
d7867712 |
| 29-Jan-2022 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Charge open/lock file contexts to kmemcg
Allow kmemcg to limit the number of open/lock file contexts, in the same way that it limits the parent file descriptors.
Signed-off-by: Trond Myklebust
NFS: Charge open/lock file contexts to kmemcg
Allow kmemcg to limit the number of open/lock file contexts, in the same way that it limits the parent file descriptors.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
show more ...
|
#
e0caaf75 |
| 08-Feb-2022 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: LOOKUP_DIRECTORY is also ok with symlinks
Commit ac795161c936 (NFSv4: Handle case where the lookup of a directory fails) [1], part of Linux since 5.17-rc2, introduced a regression, where a symb
NFS: LOOKUP_DIRECTORY is also ok with symlinks
Commit ac795161c936 (NFSv4: Handle case where the lookup of a directory fails) [1], part of Linux since 5.17-rc2, introduced a regression, where a symbolic link on an NFS mount to a directory on another NFS does not resolve(?) the first time it is accessed:
Reported-by: Paul Menzel <pmenzel@molgen.mpg.de> Fixes: ac795161c936 ("NFSv4: Handle case where the lookup of a directory fails") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Tested-by: Donald Buczek <buczek@molgen.mpg.de> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
show more ...
|
Revision tags: v5.15.18, v5.15.17, v5.4.173, v5.15.16 |
|
#
e1d2699b |
| 18-Jan-2022 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Avoid duplicate uncached readdir calls on eof
If we've reached the end of the directory, then cache that information in the context so that we don't need to do an uncached readdir in order to r
NFS: Avoid duplicate uncached readdir calls on eof
If we've reached the end of the directory, then cache that information in the context so that we don't need to do an uncached readdir in order to rediscover that fact.
Fixes: 794092c57f89 ("NFS: Do uncached readdir when we're seeking a cookie in an empty page cache") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
show more ...
|
#
ce292d8f |
| 18-Jan-2022 |
trondmy@kernel.org <trondmy@kernel.org> |
NFS: Don't skip directory entries when doing uncached readdir
Ensure that we initialise desc->cache_entry_index correctly in uncached_readdir().
Fixes: d1bacf9eb2fd ("NFS: add readdir cache array")
NFS: Don't skip directory entries when doing uncached readdir
Ensure that we initialise desc->cache_entry_index correctly in uncached_readdir().
Fixes: d1bacf9eb2fd ("NFS: add readdir cache array") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
show more ...
|
#
d9c4e39c |
| 18-Jan-2022 |
trondmy@kernel.org <trondmy@kernel.org> |
NFS: Don't overfill uncached readdir pages
If we're doing an uncached read of the directory, then we ideally want to read only the exact set of entries that will fit in the buffer supplied by the ge
NFS: Don't overfill uncached readdir pages
If we're doing an uncached read of the directory, then we ideally want to read only the exact set of entries that will fit in the buffer supplied by the getdents() system call. So unlike the case where we're reading into the page cache, let's send only one READDIR call, before trying to fill up the buffer.
Fixes: 35df59d3ef69 ("NFS: Reduce number of RPC calls when doing uncached readdir") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
show more ...
|
Revision tags: v5.15.15, v5.16 |
|
#
1751fc1d |
| 06-Jan-2022 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFSv4: nfs_atomic_open() can race when looking up a non-regular file
If the file type changes back to being a regular file on the server between the failed OPEN and our LOOKUP, then we need to re-ru
NFSv4: nfs_atomic_open() can race when looking up a non-regular file
If the file type changes back to being a regular file on the server between the failed OPEN and our LOOKUP, then we need to re-run the OPEN.
Fixes: 0dd2b474d0b6 ("nfs: implement i_op->atomic_open()") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
show more ...
|
#
ac795161 |
| 06-Jan-2022 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFSv4: Handle case where the lookup of a directory fails
If the application sets the O_DIRECTORY flag, and tries to open a regular file, nfs_atomic_open() will punt to doing a regular lookup. If the
NFSv4: Handle case where the lookup of a directory fails
If the application sets the O_DIRECTORY flag, and tries to open a regular file, nfs_atomic_open() will punt to doing a regular lookup. If the server then returns a regular file, we will happily return a file descriptor with uninitialised open state.
The fix is to return the expected ENOTDIR error in these cases.
Reported-by: Lyu Tao <tao.lyu@epfl.ch> Fixes: 0dd2b474d0b6 ("nfs: implement i_op->atomic_open()") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
show more ...
|
#
68eaba4c |
| 17-Dec-2021 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Fix the verifier for case sensitive filesystem in nfs_atomic_open()
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
|
#
00bdadc7 |
| 17-Dec-2021 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Add a helper to remove case-insensitive aliases
When dealing with case insensitive names, the client has no idea how the server performs the mapping, so cannot collapse the dentries into a sing
NFS: Add a helper to remove case-insensitive aliases
When dealing with case insensitive names, the client has no idea how the server performs the mapping, so cannot collapse the dentries into a single representative. So both rename and unlink need to deal with the fact that there could be several dentries representing the file, and have to somehow force them to be revalidated. Use d_prune_aliases() as a big hammer approach.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
show more ...
|
#
8ce37abd |
| 17-Dec-2021 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Invalidate negative dentries on all case insensitive directory changes
If we create a file, rename it, or hardlink it, then we need to assume that cached negative dentries need to be revalidate
NFS: Invalidate negative dentries on all case insensitive directory changes
If we create a file, rename it, or hardlink it, then we need to assume that cached negative dentries need to be revalidated.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
show more ...
|
#
98ca3ee6 |
| 17-Dec-2021 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFSv4: Just don't cache negative dentries on case insensitive servers
If the directory contents change, we cannot rely on the negative dentry being cacheable.
Signed-off-by: Trond Myklebust <trond.
NFSv4: Just don't cache negative dentries on case insensitive servers
If the directory contents change, we cannot rely on the negative dentry being cacheable.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
show more ...
|
Revision tags: v5.15.10, v5.15.9 |
|
#
6ff9d99b |
| 15-Dec-2021 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Ensure the server has an up to date ctime before renaming
Renaming a file is required by POSIX to update the file ctime, so ensure that the file data is synced to disk so that we don't clobber
NFS: Ensure the server has an up to date ctime before renaming
Renaming a file is required by POSIX to update the file ctime, so ensure that the file data is synced to disk so that we don't clobber the updated ctime by writing back after creating the hard link.
Fixes: f2c2c552f119 ("NFS: Move delegation recall into the NFSv4 callback for rename_setup()") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
show more ...
|
#
20497503 |
| 15-Dec-2021 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Ensure the server has an up to date ctime before hardlinking
Creating a hard link is required by POSIX to update the file ctime, so ensure that the file data is synced to disk so that we don't
NFS: Ensure the server has an up to date ctime before hardlinking
Creating a hard link is required by POSIX to update the file ctime, so ensure that the file data is synced to disk so that we don't clobber the updated ctime by writing back after creating the hard link.
Fixes: 9f7682728728 ("NFS: Move the delegation return down into nfs4_proc_link()") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
show more ...
|
Revision tags: v5.15.8, v5.15.7, v5.15.6, v5.15.5, v5.15.4, v5.15.3, v5.15.2, v5.15.1, v5.15, v5.14.14, v5.14.13, v5.14.12, v5.14.11, v5.14.10, v5.14.9 |
|
#
6238aec8 |
| 27-Sep-2021 |
NeilBrown <neilb@suse.de> |
NFS: don't store 'struct cred *' in struct nfs_access_entry
Storing the 'struct cred *' in nfs_access_entry is problematic. An active 'cred' can keep a 'struct key *' active, and a quota is imposed
NFS: don't store 'struct cred *' in struct nfs_access_entry
Storing the 'struct cred *' in nfs_access_entry is problematic. An active 'cred' can keep a 'struct key *' active, and a quota is imposed on the number of such keys that a user can maintain. Cached 'nfs_access_entry' structs have indefinite lifetime, and having these keep 'struct key's alive imposes on that quota.
So remove the 'struct cred *' and replace it with the fields we need: kuid_t, kgid_t, and struct group_info *
This makes the 'struct nfs_access_entry' 64 bits larger.
New function "access_cmp" is introduced which is identical to cred_fscmp() except that the second arg is an 'nfs_access_entry', rather than a 'cred'
Fixes: b68572e07c58 ("NFS: change access cache to use 'struct cred'.") Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
show more ...
|
#
73fbb3fa |
| 27-Sep-2021 |
NeilBrown <neilb@suse.de> |
NFS: pass cred explicitly for access tests
Storing the 'struct cred *' in nfs_access_entry is problematic. An active 'cred' can keep a 'struct key *' active, and a quota is imposed on the number of
NFS: pass cred explicitly for access tests
Storing the 'struct cred *' in nfs_access_entry is problematic. An active 'cred' can keep a 'struct key *' active, and a quota is imposed on the number of such keys that a user can maintain. Cached 'nfs_access_entry' structs have indefinite lifetime, and having these keep 'struct key's alive imposes on that quota.
So a future patch will remove the ->cred ref from nfs_access_entry.
To prepare, change various functions to not assume there is a 'cred' in the nfs_access_entry, but to pass the cred around explicitly.
Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
show more ...
|
#
b5e7b59c |
| 27-Sep-2021 |
NeilBrown <neilb@suse.de> |
NFS: change nfs_access_get_cached to only report the mask
Currently the nfs_access_get_cached family of functions report a 'struct nfs_access_entry' as the result, with both .mask and .cred set. How
NFS: change nfs_access_get_cached to only report the mask
Currently the nfs_access_get_cached family of functions report a 'struct nfs_access_entry' as the result, with both .mask and .cred set. However the .cred is never used. This is probably good and there is no guarantee that it won't be freed before use.
Change to only report the 'mask' - as this is all that is used or needed.
Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
show more ...
|
#
b6459415 |
| 28-Dec-2021 |
Jakub Kicinski <kuba@kernel.org> |
net: Don't include filter.h from net/sock.h
sock.h is pretty heavily used (5k objects rebuilt on x86 after it's touched). We can drop the include of filter.h from it and add a forward declaration of
net: Don't include filter.h from net/sock.h
sock.h is pretty heavily used (5k objects rebuilt on x86 after it's touched). We can drop the include of filter.h from it and add a forward declaration of struct sk_filter instead. This decreases the number of rebuilt objects when bpf.h is touched from ~5k to ~1k.
There's a lot of missing includes this was masking. Primarily in networking tho, this time.
Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Marc Kleine-Budde <mkl@pengutronix.de> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Acked-by: Nikolay Aleksandrov <nikolay@nvidia.com> Acked-by: Stefano Garzarella <sgarzare@redhat.com> Link: https://lore.kernel.org/bpf/20211229004913.513372-1-kuba@kernel.org
show more ...
|