#
6967d996 |
| 29-Sep-2021 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Fix dentry verifier races
[ Upstream commit cec08f452a687fce9dfdf47946d00a1d12a8bec5 ]
If the directory changed while we were revalidating the dentry, then don't update the dentry verifier. Th
NFS: Fix dentry verifier races
[ Upstream commit cec08f452a687fce9dfdf47946d00a1d12a8bec5 ]
If the directory changed while we were revalidating the dentry, then don't update the dentry verifier. There is no value in setting the verifier to an older value, and we could end up overwriting a more up to date verifier from a parallel revalidation.
Fixes: efeda80da38d ("NFSv4: Fix revalidation of dentries with delegations") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Tested-by: Benjamin Coddington <bcodding@redhat.com> Reviewed-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
show more ...
|
#
597e9c7a |
| 28-Sep-2021 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Ignore the directory size when marking for revalidation
[ Upstream commit a6a361c4ca3cc3e6f3b39d1b6bca1de90f5f4b11 ]
If we want to revalidate the directory, then just mark the change attribute
NFS: Ignore the directory size when marking for revalidation
[ Upstream commit a6a361c4ca3cc3e6f3b39d1b6bca1de90f5f4b11 ]
If we want to revalidate the directory, then just mark the change attribute as invalid.
Fixes: 13c0b082b6a9 ("NFS: Replace use of NFS_INO_REVAL_PAGECACHE when checking cache validity") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Tested-by: Benjamin Coddington <bcodding@redhat.com> Reviewed-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
show more ...
|
Revision tags: v5.13, v5.10.46, v5.10.43, v5.10.42, v5.10.41, v5.10.40, v5.10.39, v5.4.119, v5.10.36, v5.10.35 |
|
#
fa60ce2c |
| 06-May-2021 |
Masahiro Yamada <masahiroy@kernel.org> |
treewide: remove editor modelines and cruft
The section "19) Editor modelines and other cruft" in Documentation/process/coding-style.rst clearly says, "Do not include any of these in source files."
treewide: remove editor modelines and cruft
The section "19) Editor modelines and other cruft" in Documentation/process/coding-style.rst clearly says, "Do not include any of these in source files."
I recently receive a patch to explicitly add a new one.
Let's do treewide cleanups, otherwise some people follow the existing code and attempt to upstream their favoriate editor setups.
It is even nicer if scripts/checkpatch.pl can check it.
If we like to impose coding style in an editor-independent manner, I think editorconfig (patch [1]) is a saner solution.
[1] https://lore.kernel.org/lkml/20200703073143.423557-1-danny@kdrag0n.dev/
Link: https://lkml.kernel.org/r/20210324054457.1477489-1-masahiroy@kernel.org Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Miguel Ojeda <ojeda@kernel.org> [auxdisplay] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
show more ...
|
Revision tags: v5.10.34, v5.4.116, v5.10.33, v5.12, v5.10.32, v5.10.31, v5.10.30 |
|
#
1301e421 |
| 01-Apr-2021 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFSv4: link must update the inode nlink.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
#
720869eb |
| 13-Apr-2021 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Separate tracking of file mode cache validity from the uid/gid
chown()/chgrp() and chmod() are separate operations, and in addition, there are mode operations that are performed automatically b
NFS: Separate tracking of file mode cache validity from the uid/gid
chown()/chgrp() and chmod() are separate operations, and in addition, there are mode operations that are performed automatically by the server. So let's track mode validity separately from the file ownership validity.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
show more ...
|
Revision tags: v5.10.27 |
|
#
fabf2b34 |
| 25-Mar-2021 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Separate tracking of file nlinks cache validity from the mode/uid/gid
Rename can cause us to revalidate the access cache, so lets track the nlinks separately from the mode/uid/gid.
Signed-off-
NFS: Separate tracking of file nlinks cache validity from the mode/uid/gid
Rename can cause us to revalidate the access cache, so lets track the nlinks separately from the mode/uid/gid.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
show more ...
|
#
1f3208b2 |
| 25-Mar-2021 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Add a cache validity flag argument to nfs_revalidate_inode()
Add an argument to nfs_revalidate_inode() to allow callers to specify which attributes they need to check for validity.
Signed-off-
NFS: Add a cache validity flag argument to nfs_revalidate_inode()
Add an argument to nfs_revalidate_inode() to allow callers to specify which attributes they need to check for validity.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
show more ...
|
Revision tags: v5.10.26, v5.10.25, v5.10.24 |
|
#
f892c41c |
| 17-Mar-2021 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Only change the cookie verifier if the directory page cache is empty
The cached NFSv3/v4 readdir cookies are associated with a verifier, which is checked by the server on subsequent calls to re
NFS: Only change the cookie verifier if the directory page cache is empty
The cached NFSv3/v4 readdir cookies are associated with a verifier, which is checked by the server on subsequent calls to readdir, and is only expected to change when the cookies (and hence also the page cache contents) are considered invalid. We therefore do have to store the verifier, but only when the page cache is empty.
Fixes: b593c09f83a2 ("NFS: Improve handling of directory verifiers") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
show more ...
|
#
13884ff2 |
| 16-Mar-2021 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Fix handling of cookie verifier in uncached_readdir()
If we're doing uncached readdir(), then the readdir cookie could be different from the one cached in the nfs_inode. We should therefore ens
NFS: Fix handling of cookie verifier in uncached_readdir()
If we're doing uncached readdir(), then the readdir cookie could be different from the one cached in the nfs_inode. We should therefore ensure that we save that one in the struct nfs_open_dir_context.
Fixes: 35df59d3ef69 ("NFS: Reduce number of RPC calls when doing uncached readdir") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
show more ...
|
#
ee3707ae |
| 16-Mar-2021 |
Nagendra S Tomar <natomar@microsoft.com> |
nfs: Subsequent READDIR calls should carry non-zero cookieverifier
If the loop in nfs_readdir_xdr_to_array() runs more than once, subsequent READDIR RPCs may wrongly carry a zero cookie verifier and
nfs: Subsequent READDIR calls should carry non-zero cookieverifier
If the loop in nfs_readdir_xdr_to_array() runs more than once, subsequent READDIR RPCs may wrongly carry a zero cookie verifier and non-zero cookie. Make sure subsequent calls to READDIR carry the cookie verifier returned by the first call.
Signed-off-by: Nagendra S Tomar <natomar@microsoft.com> Fixes: b593c09f83a2 ("NFS: Improve handling of directory verifiers") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
show more ...
|
Revision tags: v5.10.23, v5.10.22 |
|
#
ac46b3d7 |
| 08-Mar-2021 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Fix open coded versions of nfs_set_cache_invalid()
nfs_set_cache_invalid() has code to handle delegations, and other optimisations, so let's use it when appropriate.
Signed-off-by: Trond Mykle
NFS: Fix open coded versions of nfs_set_cache_invalid()
nfs_set_cache_invalid() has code to handle delegations, and other optimisations, so let's use it when appropriate.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
show more ...
|
#
fd6d3fee |
| 08-Mar-2021 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Clean up function nfs_mark_dir_for_revalidate()
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
|
#
47397915 |
| 08-Mar-2021 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Don't gratuitously clear the inode cache when lookup failed
The fact that the lookup revalidation failed, does not mean that the inode contents have changed.
Fixes: 5ceb9d7fdaaf ("NFS: Refacto
NFS: Don't gratuitously clear the inode cache when lookup failed
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>
show more ...
|
#
82e7ca13 |
| 08-Mar-2021 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Don't revalidate the directory permissions on a lookup failure
There should be no reason to expect the directory permissions to change just because the directory contents changed or a negative
NFS: Don't revalidate the directory permissions on a lookup failure
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>
show more ...
|
Revision tags: v5.10.21, v5.10.20, v5.10.19, v5.4.101, v5.10.18, v5.10.17, v5.11, v5.10.16, v5.10.15, v5.10.14 |
|
#
549c7297 |
| 21-Jan-2021 |
Christian Brauner <christian.brauner@ubuntu.com> |
fs: make helpers idmap mount aware
Extend some inode methods with an additional user namespace argument. A filesystem that is aware of idmapped mounts will receive the user namespace the mount has b
fs: make helpers idmap mount aware
Extend some inode methods with an additional user namespace argument. A filesystem that is aware of idmapped mounts will receive the user namespace the mount has been marked with. This can be used for additional permission checking and also to enable filesystems to translate between uids and gids if they need to. We have implemented all relevant helpers in earlier patches.
As requested we simply extend the exisiting inode method instead of introducing new ones. This is a little more code churn but it's mostly mechanical and doesnt't leave us with additional inode methods.
Link: https://lore.kernel.org/r/20210121131959.646623-25-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> Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
show more ...
|
#
47291baa |
| 21-Jan-2021 |
Christian Brauner <christian.brauner@ubuntu.com> |
namei: make permission helpers idmapped mount aware
The two helpers inode_permission() and generic_permission() are used by the vfs to perform basic permission checking by verifying that the caller
namei: make permission helpers idmapped mount aware
The two helpers inode_permission() and generic_permission() are used by the vfs to perform basic permission checking by verifying that the caller is privileged over an inode. In order to handle idmapped mounts we extend the two helpers with an additional user namespace argument. On idmapped mounts the two helpers will make sure to map the inode according to the mount's user namespace and then peform identical permission checks to inode_permission() and generic_permission(). If the initial user namespace is passed nothing changes so non-idmapped mounts will see identical behavior as before.
Link: https://lore.kernel.org/r/20210121131959.646623-6-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> Reviewed-by: James Morris <jamorris@linux.microsoft.com> Acked-by: Serge Hallyn <serge@hallyn.com> Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
show more ...
|
Revision tags: v5.10 |
|
#
794092c5 |
| 06-Nov-2020 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Do uncached readdir when we're seeking a cookie in an empty page cache
If the directory is changing, causing the page cache to get invalidated while we are listing the contents, then the NFS cl
NFS: Do uncached readdir when we're seeking a cookie in an empty page cache
If the directory is changing, causing the page cache to get invalidated while we are listing the contents, then the NFS client is currently forced to read in the entire directory contents from scratch, because it needs to perform a linear search for the readdir cookie. While this is not an issue for small directories, it does not scale to directories with millions of entries. In order to be able to deal with large directories that are changing, add a heuristic to ensure that if the page cache is empty, and we are searching for a cookie that is not the zero cookie, we just default to performing uncached readdir.
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 ...
|
#
35df59d3 |
| 06-Nov-2020 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Reduce number of RPC calls when doing uncached readdir
If we're doing uncached readdir, allocate multiple pages in order to try to avoid duplicate RPC calls for the same getdents() call.
Signe
NFS: Reduce number of RPC calls when doing uncached readdir
If we're doing uncached readdir, allocate multiple pages in order to try to avoid duplicate RPC calls for the same getdents() call.
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 ...
|
#
762567b7 |
| 04-Nov-2020 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Optimisations for monotonically increasing readdir cookies
If the server is handing out monotonically increasing readdir cookie values, then we can optimise away searches through pages that con
NFS: Optimisations for monotonically increasing readdir cookies
If the server is handing out monotonically increasing readdir cookie values, then we can optimise away searches through pages that contain cookies that lie outside our search range.
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 ...
|
#
b593c09f |
| 02-Nov-2020 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Improve handling of directory verifiers
If the server insists on using the readdir verifiers in order to allow cookies to expire, then we should ensure that we cache the verifier with the cooki
NFS: Improve handling of directory verifiers
If the server insists on using the readdir verifiers in order to allow cookies to expire, then we should ensure that we cache the verifier with the cookie, so that we can return an error if the application tries to use the expired cookie.
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 ...
|
#
9fff59ed |
| 02-Nov-2020 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Handle NFS4ERR_NOT_SAME and NFSERR_BADCOOKIE from readdir calls
If the server returns NFS4ERR_NOT_SAME or tells us that the cookie is bad in response to a READDIR call, then we should empty the
NFS: Handle NFS4ERR_NOT_SAME and NFSERR_BADCOOKIE from readdir calls
If the server returns NFS4ERR_NOT_SAME or tells us that the cookie is bad in response to a READDIR call, then we should empty the page cache so that we can fill it from scratch again.
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 ...
|
#
82e22a5e |
| 02-Nov-2020 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Allow the NFS generic code to pass in a verifier to readdir
If we're ever going to allow support for servers that use the readdir verifier, then that use needs to be managed by the middle layer
NFS: Allow the NFS generic code to pass in a verifier to readdir
If we're ever going to allow support for servers that use the readdir verifier, then that use needs to be managed by the middle layers as those need to be able to reject cookies from other verifiers.
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 ...
|
#
6c981eff |
| 03-Nov-2020 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Cleanup to remove nfs_readdir_descriptor_t typedef
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Reviewed-by: Benjamin Coddington <bcodding@redhat.com> Tested-by: Benjamin Co
NFS: Cleanup to remove nfs_readdir_descriptor_t typedef
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 ...
|
#
6b75cf9e |
| 02-Nov-2020 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: Reduce readdir stack usage
The descriptor and the struct nfs_entry are both large structures, so don't allocate them from the stack.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace
NFS: Reduce readdir stack usage
The descriptor and the struct nfs_entry are both large structures, so don't allocate them from the stack.
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 ...
|
#
dbeaf8c9 |
| 01-Nov-2020 |
Trond Myklebust <trond.myklebust@hammerspace.com> |
NFS: nfs_do_filldir() does not return a value
Clean up nfs_do_filldir().
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Reviewed-by: Benjamin Coddington <bcodding@redhat.com> Test
NFS: nfs_do_filldir() does not return a value
Clean up nfs_do_filldir().
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 ...
|