All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Support case insensitive filesystems in NFSv4
@ 2021-12-17 20:36 trondmy
  2021-12-17 20:36 ` [PATCH 1/5] NFSv4: Add some support for case insensitive filesystems trondmy
  2022-01-03 20:08 ` [PATCH 0/5] Support case insensitive filesystems in NFSv4 J. Bruce Fields
  0 siblings, 2 replies; 10+ messages in thread
From: trondmy @ 2021-12-17 20:36 UTC (permalink / raw)
  To: Anna Schumaker; +Cc: linux-nfs

From: Trond Myklebust <trond.myklebust@hammerspace.com>

Add support for detecting an export of a case insensitive filesystem in
NFSv4. If that is the case, then we need to adjust the dentry caching
and invalidation rules to ensure that we don't inadvertently end up
caching other case folded aliases after an operation that results in a
directory entry name change.

Trond Myklebust (5):
  NFSv4: Add some support for case insensitive filesystems
  NFSv4: Just don't cache negative dentries on case insensitive servers
  NFS: Invalidate negative dentries on all case insensitive directory
    changes
  NFS: Add a helper to remove case-insensitive aliases
  NFS: Fix the verifier for case sensitive filesystem in
    nfs_atomic_open()

 fs/nfs/dir.c              | 41 +++++++++++++++++++++++++++++++++------
 fs/nfs/internal.h         |  1 +
 fs/nfs/nfs4proc.c         | 13 +++++++++++--
 fs/nfs/nfs4xdr.c          | 40 ++++++++++++++++++++++++++++++++++++++
 include/linux/nfs_fs_sb.h |  2 ++
 include/linux/nfs_xdr.h   |  2 ++
 6 files changed, 91 insertions(+), 8 deletions(-)

-- 
2.33.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/5] NFSv4: Add some support for case insensitive filesystems
  2021-12-17 20:36 [PATCH 0/5] Support case insensitive filesystems in NFSv4 trondmy
@ 2021-12-17 20:36 ` trondmy
  2021-12-17 20:36   ` [PATCH 2/5] NFSv4: Just don't cache negative dentries on case insensitive servers trondmy
  2022-01-03 20:08 ` [PATCH 0/5] Support case insensitive filesystems in NFSv4 J. Bruce Fields
  1 sibling, 1 reply; 10+ messages in thread
From: trondmy @ 2021-12-17 20:36 UTC (permalink / raw)
  To: Anna Schumaker; +Cc: linux-nfs

From: Trond Myklebust <trond.myklebust@primarydata.com>

Add capabilities to allow the NFS client to recognise when it is dealing
with case insensitive and case preserving filesystems.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
---
 fs/nfs/nfs4proc.c         |  8 +++++++-
 fs/nfs/nfs4xdr.c          | 40 +++++++++++++++++++++++++++++++++++++++
 include/linux/nfs_fs_sb.h |  2 ++
 include/linux/nfs_xdr.h   |  2 ++
 4 files changed, 51 insertions(+), 1 deletion(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 535436dbdc9a..422375149c7c 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3840,7 +3840,9 @@ static int _nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *f
 		     FATTR4_WORD0_FH_EXPIRE_TYPE |
 		     FATTR4_WORD0_LINK_SUPPORT |
 		     FATTR4_WORD0_SYMLINK_SUPPORT |
-		     FATTR4_WORD0_ACLSUPPORT;
+		     FATTR4_WORD0_ACLSUPPORT |
+		     FATTR4_WORD0_CASE_INSENSITIVE |
+		     FATTR4_WORD0_CASE_PRESERVING;
 	if (minorversion)
 		bitmask[2] = FATTR4_WORD2_SUPPATTR_EXCLCREAT;
 
@@ -3869,6 +3871,10 @@ static int _nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *f
 			server->caps |= NFS_CAP_HARDLINKS;
 		if (res.has_symlinks != 0)
 			server->caps |= NFS_CAP_SYMLINKS;
+		if (res.case_insensitive)
+			server->caps |= NFS_CAP_CASE_INSENSITIVE;
+		if (res.case_preserving)
+			server->caps |= NFS_CAP_CASE_PRESERVING;
 #ifdef CONFIG_NFS_V4_SECURITY_LABEL
 		if (res.attr_bitmask[2] & FATTR4_WORD2_SECURITY_LABEL)
 			server->caps |= NFS_CAP_SECURITY_LABEL;
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 69862bf6db00..c7250645e8b4 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -3533,6 +3533,42 @@ static int decode_attr_aclsupport(struct xdr_stream *xdr, uint32_t *bitmap, uint
 	return 0;
 }
 
+static int decode_attr_case_insensitive(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res)
+{
+	__be32 *p;
+
+	*res = 0;
+	if (unlikely(bitmap[0] & (FATTR4_WORD0_CASE_INSENSITIVE - 1U)))
+		return -EIO;
+	if (likely(bitmap[0] & FATTR4_WORD0_CASE_INSENSITIVE)) {
+		p = xdr_inline_decode(xdr, 4);
+		if (unlikely(!p))
+			return -EIO;
+		*res = be32_to_cpup(p);
+		bitmap[0] &= ~FATTR4_WORD0_CASE_INSENSITIVE;
+	}
+	dprintk("%s: case_insensitive=%s\n", __func__, *res == 0 ? "false" : "true");
+	return 0;
+}
+
+static int decode_attr_case_preserving(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res)
+{
+	__be32 *p;
+
+	*res = 0;
+	if (unlikely(bitmap[0] & (FATTR4_WORD0_CASE_PRESERVING - 1U)))
+		return -EIO;
+	if (likely(bitmap[0] & FATTR4_WORD0_CASE_PRESERVING)) {
+		p = xdr_inline_decode(xdr, 4);
+		if (unlikely(!p))
+			return -EIO;
+		*res = be32_to_cpup(p);
+		bitmap[0] &= ~FATTR4_WORD0_CASE_PRESERVING;
+	}
+	dprintk("%s: case_preserving=%s\n", __func__, *res == 0 ? "false" : "true");
+	return 0;
+}
+
 static int decode_attr_fileid(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *fileid)
 {
 	__be32 *p;
@@ -4412,6 +4448,10 @@ static int decode_server_caps(struct xdr_stream *xdr, struct nfs4_server_caps_re
 		goto xdr_error;
 	if ((status = decode_attr_aclsupport(xdr, bitmap, &res->acl_bitmask)) != 0)
 		goto xdr_error;
+	if ((status = decode_attr_case_insensitive(xdr, bitmap, &res->case_insensitive)) != 0)
+		goto xdr_error;
+	if ((status = decode_attr_case_preserving(xdr, bitmap, &res->case_preserving)) != 0)
+		goto xdr_error;
 	if ((status = decode_attr_exclcreat_supported(xdr, bitmap,
 				res->exclcreat_bitmask)) != 0)
 		goto xdr_error;
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 2a9acbfe00f0..f24fc67af42d 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -271,6 +271,8 @@ struct nfs_server {
 #define NFS_CAP_ACLS		(1U << 3)
 #define NFS_CAP_ATOMIC_OPEN	(1U << 4)
 #define NFS_CAP_LGOPEN		(1U << 5)
+#define NFS_CAP_CASE_INSENSITIVE	(1U << 6)
+#define NFS_CAP_CASE_PRESERVING	(1U << 7)
 #define NFS_CAP_POSIX_LOCK	(1U << 14)
 #define NFS_CAP_UIDGID_NOMAP	(1U << 15)
 #define NFS_CAP_STATEID_NFSV41	(1U << 16)
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 967a0098f0a9..1d1f77809d5e 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1194,6 +1194,8 @@ struct nfs4_server_caps_res {
 	u32				has_links;
 	u32				has_symlinks;
 	u32				fh_expire_type;
+	u32				case_insensitive;
+	u32				case_preserving;
 };
 
 #define NFS4_PATHNAME_MAXCOMPONENTS 512
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/5] NFSv4: Just don't cache negative dentries on case insensitive servers
  2021-12-17 20:36 ` [PATCH 1/5] NFSv4: Add some support for case insensitive filesystems trondmy
@ 2021-12-17 20:36   ` trondmy
  2021-12-17 20:36     ` [PATCH 3/5] NFS: Invalidate negative dentries on all case insensitive directory changes trondmy
  0 siblings, 1 reply; 10+ messages in thread
From: trondmy @ 2021-12-17 20:36 UTC (permalink / raw)
  To: Anna Schumaker; +Cc: linux-nfs

From: Trond Myklebust <trond.myklebust@hammerspace.com>

If the directory contents change, we cannot rely on the negative dentry
being cacheable.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
---
 fs/nfs/dir.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 731d31015b6a..2822681192b0 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1436,6 +1436,9 @@ int nfs_neg_need_reval(struct inode *dir, struct dentry *dentry,
 		return 0;
 	if (NFS_SERVER(dir)->flags & NFS_MOUNT_LOOKUP_CACHE_NONEG)
 		return 1;
+	/* Case insensitive server? Revalidate negative dentries */
+	if (nfs_server_capable(dir, NFS_CAP_CASE_INSENSITIVE))
+		return 1;
 	return !nfs_check_verifier(dir, dentry, flags & LOOKUP_RCU);
 }
 
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/5] NFS: Invalidate negative dentries on all case insensitive directory changes
  2021-12-17 20:36   ` [PATCH 2/5] NFSv4: Just don't cache negative dentries on case insensitive servers trondmy
@ 2021-12-17 20:36     ` trondmy
  2021-12-17 20:36       ` [PATCH 4/5] NFS: Add a helper to remove case-insensitive aliases trondmy
  0 siblings, 1 reply; 10+ messages in thread
From: trondmy @ 2021-12-17 20:36 UTC (permalink / raw)
  To: Anna Schumaker; +Cc: linux-nfs

From: Trond Myklebust <trond.myklebust@hammerspace.com>

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>
---
 fs/nfs/dir.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 2822681192b0..8ed943081e3d 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1324,6 +1324,14 @@ void nfs_clear_verifier_delegated(struct inode *inode)
 EXPORT_SYMBOL_GPL(nfs_clear_verifier_delegated);
 #endif /* IS_ENABLED(CONFIG_NFS_V4) */
 
+static int nfs_dentry_verify_change(struct inode *dir, struct dentry *dentry)
+{
+	if (nfs_server_capable(dir, NFS_CAP_CASE_INSENSITIVE) &&
+	    d_really_is_negative(dentry))
+		return dentry->d_time == inode_peek_iversion_raw(dir);
+	return nfs_verify_change_attribute(dir, dentry->d_time);
+}
+
 /*
  * A check for whether or not the parent directory has changed.
  * In the case it has, we assume that the dentries are untrustworthy
@@ -1337,7 +1345,7 @@ static int nfs_check_verifier(struct inode *dir, struct dentry *dentry,
 		return 1;
 	if (NFS_SERVER(dir)->flags & NFS_MOUNT_LOOKUP_CACHE_NONE)
 		return 0;
-	if (!nfs_verify_change_attribute(dir, dentry->d_time))
+	if (!nfs_dentry_verify_change(dir, dentry))
 		return 0;
 	/* Revalidate nfsi->cache_change_attribute before we declare a match */
 	if (nfs_mapping_need_revalidate_inode(dir)) {
@@ -1346,7 +1354,7 @@ static int nfs_check_verifier(struct inode *dir, struct dentry *dentry,
 		if (__nfs_revalidate_inode(NFS_SERVER(dir), dir) < 0)
 			return 0;
 	}
-	if (!nfs_verify_change_attribute(dir, dentry->d_time))
+	if (!nfs_dentry_verify_change(dir, dentry))
 		return 0;
 	return 1;
 }
@@ -1539,7 +1547,7 @@ nfs_lookup_revalidate_dentry(struct inode *dir, struct dentry *dentry,
 	 * If the lookup failed despite the dentry change attribute being
 	 * a match, then we should revalidate the directory cache.
 	 */
-	if (!ret && nfs_verify_change_attribute(dir, dentry->d_time))
+	if (!ret && nfs_dentry_verify_change(dir, dentry))
 		nfs_mark_dir_for_revalidate(dir);
 	return nfs_lookup_revalidate_done(dir, dentry, inode, ret);
 }
@@ -1778,8 +1786,11 @@ struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned in
 	dir_verifier = nfs_save_change_attribute(dir);
 	trace_nfs_lookup_enter(dir, dentry, flags);
 	error = NFS_PROTO(dir)->lookup(dir, dentry, fhandle, fattr);
-	if (error == -ENOENT)
+	if (error == -ENOENT) {
+		if (nfs_server_capable(dir, NFS_CAP_CASE_INSENSITIVE))
+			dir_verifier = inode_peek_iversion_raw(dir);
 		goto no_entry;
+	}
 	if (error < 0) {
 		res = ERR_PTR(error);
 		goto out;
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/5] NFS: Add a helper to remove case-insensitive aliases
  2021-12-17 20:36     ` [PATCH 3/5] NFS: Invalidate negative dentries on all case insensitive directory changes trondmy
@ 2021-12-17 20:36       ` trondmy
  2021-12-17 20:36         ` [PATCH 5/5] NFS: Fix the verifier for case sensitive filesystem in nfs_atomic_open() trondmy
  0 siblings, 1 reply; 10+ messages in thread
From: trondmy @ 2021-12-17 20:36 UTC (permalink / raw)
  To: Anna Schumaker; +Cc: linux-nfs

From: Trond Myklebust <trond.myklebust@hammerspace.com>

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>
---
 fs/nfs/dir.c      | 12 +++++++++++-
 fs/nfs/internal.h |  1 +
 fs/nfs/nfs4proc.c |  5 ++++-
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 8ed943081e3d..a490704e10ed 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1819,6 +1819,14 @@ struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned in
 }
 EXPORT_SYMBOL_GPL(nfs_lookup);
 
+void nfs_d_prune_case_insensitive_aliases(struct inode *inode)
+{
+	/* Case insensitive server? Revalidate dentries */
+	if (inode && nfs_server_capable(inode, NFS_CAP_CASE_INSENSITIVE))
+		d_prune_aliases(inode);
+}
+EXPORT_SYMBOL_GPL(nfs_d_prune_case_insensitive_aliases);
+
 #if IS_ENABLED(CONFIG_NFS_V4)
 static int nfs4_lookup_revalidate(struct dentry *, unsigned int);
 
@@ -2199,8 +2207,10 @@ static void nfs_dentry_remove_handle_error(struct inode *dir,
 	switch (error) {
 	case -ENOENT:
 		d_delete(dentry);
-		fallthrough;
+		nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
+		break;
 	case 0:
+		nfs_d_prune_case_insensitive_aliases(d_inode(dentry));
 		nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
 	}
 }
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index 12f6acb483bb..2de7c56a1fbe 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -373,6 +373,7 @@ extern unsigned long nfs_access_cache_count(struct shrinker *shrink,
 extern unsigned long nfs_access_cache_scan(struct shrinker *shrink,
 					   struct shrink_control *sc);
 struct dentry *nfs_lookup(struct inode *, struct dentry *, unsigned int);
+void nfs_d_prune_case_insensitive_aliases(struct inode *inode);
 int nfs_create(struct user_namespace *, struct inode *, struct dentry *,
 	       umode_t, bool);
 int nfs_mkdir(struct user_namespace *, struct inode *, struct dentry *,
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 422375149c7c..5e8be04dbe84 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -4668,8 +4668,10 @@ static void nfs4_proc_unlink_setup(struct rpc_message *msg,
 
 	nfs_fattr_init(res->dir_attr);
 
-	if (inode)
+	if (inode) {
 		nfs4_inode_return_delegation(inode);
+		nfs_d_prune_case_insensitive_aliases(inode);
+	}
 }
 
 static void nfs4_proc_unlink_rpc_prepare(struct rpc_task *task, struct nfs_unlinkdata *data)
@@ -4735,6 +4737,7 @@ static int nfs4_proc_rename_done(struct rpc_task *task, struct inode *old_dir,
 		return 0;
 
 	if (task->tk_status == 0) {
+		nfs_d_prune_case_insensitive_aliases(d_inode(data->old_dentry));
 		if (new_dir != old_dir) {
 			/* Note: If we moved a directory, nlink will change */
 			nfs4_update_changeattr(old_dir, &res->old_cinfo,
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/5] NFS: Fix the verifier for case sensitive filesystem in nfs_atomic_open()
  2021-12-17 20:36       ` [PATCH 4/5] NFS: Add a helper to remove case-insensitive aliases trondmy
@ 2021-12-17 20:36         ` trondmy
  0 siblings, 0 replies; 10+ messages in thread
From: trondmy @ 2021-12-17 20:36 UTC (permalink / raw)
  To: Anna Schumaker; +Cc: linux-nfs

From: Trond Myklebust <trond.myklebust@hammerspace.com>

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
---
 fs/nfs/dir.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index a490704e10ed..9432820ce21c 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1888,6 +1888,7 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
 	struct iattr attr = { .ia_valid = ATTR_OPEN };
 	struct inode *inode;
 	unsigned int lookup_flags = 0;
+	unsigned long dir_verifier;
 	bool switched = false;
 	int created = 0;
 	int err;
@@ -1961,7 +1962,11 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
 		switch (err) {
 		case -ENOENT:
 			d_splice_alias(NULL, dentry);
-			nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
+			if (nfs_server_capable(dir, NFS_CAP_CASE_INSENSITIVE))
+				dir_verifier = inode_peek_iversion_raw(dir);
+			else
+				dir_verifier = nfs_save_change_attribute(dir);
+			nfs_set_verifier(dentry, dir_verifier);
 			break;
 		case -EISDIR:
 		case -ENOTDIR:
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/5] Support case insensitive filesystems in NFSv4
  2021-12-17 20:36 [PATCH 0/5] Support case insensitive filesystems in NFSv4 trondmy
  2021-12-17 20:36 ` [PATCH 1/5] NFSv4: Add some support for case insensitive filesystems trondmy
@ 2022-01-03 20:08 ` J. Bruce Fields
  2022-01-03 20:11   ` Trond Myklebust
  1 sibling, 1 reply; 10+ messages in thread
From: J. Bruce Fields @ 2022-01-03 20:08 UTC (permalink / raw)
  To: trondmy; +Cc: Anna Schumaker, linux-nfs

On Fri, Dec 17, 2021 at 03:36:53PM -0500, trondmy@kernel.org wrote:
> From: Trond Myklebust <trond.myklebust@hammerspace.com>
> 
> Add support for detecting an export of a case insensitive filesystem in
> NFSv4. If that is the case, then we need to adjust the dentry caching
> and invalidation rules to ensure that we don't inadvertently end up
> caching other case folded aliases after an operation that results in a
> directory entry name change.

What server and configuration are you testing this against?

--b.

> 
> Trond Myklebust (5):
>   NFSv4: Add some support for case insensitive filesystems
>   NFSv4: Just don't cache negative dentries on case insensitive servers
>   NFS: Invalidate negative dentries on all case insensitive directory
>     changes
>   NFS: Add a helper to remove case-insensitive aliases
>   NFS: Fix the verifier for case sensitive filesystem in
>     nfs_atomic_open()
> 
>  fs/nfs/dir.c              | 41 +++++++++++++++++++++++++++++++++------
>  fs/nfs/internal.h         |  1 +
>  fs/nfs/nfs4proc.c         | 13 +++++++++++--
>  fs/nfs/nfs4xdr.c          | 40 ++++++++++++++++++++++++++++++++++++++
>  include/linux/nfs_fs_sb.h |  2 ++
>  include/linux/nfs_xdr.h   |  2 ++
>  6 files changed, 91 insertions(+), 8 deletions(-)
> 
> -- 
> 2.33.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/5] Support case insensitive filesystems in NFSv4
  2022-01-03 20:08 ` [PATCH 0/5] Support case insensitive filesystems in NFSv4 J. Bruce Fields
@ 2022-01-03 20:11   ` Trond Myklebust
  2022-01-03 21:46     ` bfields
  0 siblings, 1 reply; 10+ messages in thread
From: Trond Myklebust @ 2022-01-03 20:11 UTC (permalink / raw)
  To: bfields, trondmy; +Cc: linux-nfs, anna.schumaker

On Mon, 2022-01-03 at 15:08 -0500, J. Bruce Fields wrote:
> On Fri, Dec 17, 2021 at 03:36:53PM -0500, trondmy@kernel.org wrote:
> > From: Trond Myklebust <trond.myklebust@hammerspace.com>
> > 
> > Add support for detecting an export of a case insensitive
> > filesystem in
> > NFSv4. If that is the case, then we need to adjust the dentry
> > caching
> > and invalidation rules to ensure that we don't inadvertently end up
> > caching other case folded aliases after an operation that results
> > in a
> > directory entry name change.
> 
> What server and configuration are you testing this against?
> 
> 

Ours. Why?

> --b.
> 
> > 
> > Trond Myklebust (5):
> >   NFSv4: Add some support for case insensitive filesystems
> >   NFSv4: Just don't cache negative dentries on case insensitive
> > servers
> >   NFS: Invalidate negative dentries on all case insensitive
> > directory
> >     changes
> >   NFS: Add a helper to remove case-insensitive aliases
> >   NFS: Fix the verifier for case sensitive filesystem in
> >     nfs_atomic_open()
> > 
> >  fs/nfs/dir.c              | 41 +++++++++++++++++++++++++++++++++--
> > ----
> >  fs/nfs/internal.h         |  1 +
> >  fs/nfs/nfs4proc.c         | 13 +++++++++++--
> >  fs/nfs/nfs4xdr.c          | 40
> > ++++++++++++++++++++++++++++++++++++++
> >  include/linux/nfs_fs_sb.h |  2 ++
> >  include/linux/nfs_xdr.h   |  2 ++
> >  6 files changed, 91 insertions(+), 8 deletions(-)
> > 
> > -- 
> > 2.33.1

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/5] Support case insensitive filesystems in NFSv4
  2022-01-03 20:11   ` Trond Myklebust
@ 2022-01-03 21:46     ` bfields
  2022-01-03 22:13       ` Trond Myklebust
  0 siblings, 1 reply; 10+ messages in thread
From: bfields @ 2022-01-03 21:46 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: trondmy, linux-nfs, anna.schumaker

On Mon, Jan 03, 2022 at 08:11:57PM +0000, Trond Myklebust wrote:
> On Mon, 2022-01-03 at 15:08 -0500, J. Bruce Fields wrote:
> > On Fri, Dec 17, 2021 at 03:36:53PM -0500, trondmy@kernel.org wrote:
> > > From: Trond Myklebust <trond.myklebust@hammerspace.com>
> > > 
> > > Add support for detecting an export of a case insensitive
> > > filesystem in
> > > NFSv4. If that is the case, then we need to adjust the dentry
> > > caching
> > > and invalidation rules to ensure that we don't inadvertently end up
> > > caching other case folded aliases after an operation that results
> > > in a
> > > directory entry name change.
> > 
> > What server and configuration are you testing this against?
> 
> Ours.

You mean, hammerspace?

> Why?

Partly just curiousity.  Partly I thought we'd previously been trying to
add features on server and client side together when it makes sense, if
only to make it possible to test without access to proprietary software.

I don't actually have a strong opinion on the policy, but if this *is* a
change in policy then it's worth mentioning.

There should be other exportable filesystems supporting those attributes
so the work to export them on the server side wouldn't be a whole lot.
(But I can't volunteer.)

--b.

> > > 
> > > Trond Myklebust (5):
> > >   NFSv4: Add some support for case insensitive filesystems
> > >   NFSv4: Just don't cache negative dentries on case insensitive
> > > servers
> > >   NFS: Invalidate negative dentries on all case insensitive
> > > directory
> > >     changes
> > >   NFS: Add a helper to remove case-insensitive aliases
> > >   NFS: Fix the verifier for case sensitive filesystem in
> > >     nfs_atomic_open()
> > > 
> > >  fs/nfs/dir.c              | 41 +++++++++++++++++++++++++++++++++--
> > > ----
> > >  fs/nfs/internal.h         |  1 +
> > >  fs/nfs/nfs4proc.c         | 13 +++++++++++--
> > >  fs/nfs/nfs4xdr.c          | 40
> > > ++++++++++++++++++++++++++++++++++++++
> > >  include/linux/nfs_fs_sb.h |  2 ++
> > >  include/linux/nfs_xdr.h   |  2 ++
> > >  6 files changed, 91 insertions(+), 8 deletions(-)
> > > 
> > > -- 
> > > 2.33.1
> 
> -- 
> Trond Myklebust
> Linux NFS client maintainer, Hammerspace
> trond.myklebust@hammerspace.com
> 
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/5] Support case insensitive filesystems in NFSv4
  2022-01-03 21:46     ` bfields
@ 2022-01-03 22:13       ` Trond Myklebust
  0 siblings, 0 replies; 10+ messages in thread
From: Trond Myklebust @ 2022-01-03 22:13 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs, anna.schumaker

On Mon, 2022-01-03 at 16:46 -0500, bfields@fieldses.org wrote:
> On Mon, Jan 03, 2022 at 08:11:57PM +0000, Trond Myklebust wrote:
> > On Mon, 2022-01-03 at 15:08 -0500, J. Bruce Fields wrote:
> > > On Fri, Dec 17, 2021 at 03:36:53PM -0500,
> > > trondmy@kernel.org wrote:
> > > > From: Trond Myklebust <trond.myklebust@hammerspace.com>
> > > > 
> > > > Add support for detecting an export of a case insensitive
> > > > filesystem in
> > > > NFSv4. If that is the case, then we need to adjust the dentry
> > > > caching
> > > > and invalidation rules to ensure that we don't inadvertently
> > > > end up
> > > > caching other case folded aliases after an operation that
> > > > results
> > > > in a
> > > > directory entry name change.
> > > 
> > > What server and configuration are you testing this against?
> > 
> > Ours.
> 
> You mean, hammerspace?
> 
> > Why?
> 
> Partly just curiousity.  Partly I thought we'd previously been trying
> to
> add features on server and client side together when it makes sense,
> if
> only to make it possible to test without access to proprietary
> software.
> 
> I don't actually have a strong opinion on the policy, but if this
> *is* a
> change in policy then it's worth mentioning.
> 
> There should be other exportable filesystems supporting those
> attributes
> so the work to export them on the server side wouldn't be a whole
> lot.
> (But I can't volunteer.)
> 
> --b.
> 
> > > > 

I don't see how it can be considered a change in policy or why it
matters if it was. We already have plenty of features in the client
which are not supported by knfsd, including several pNFS features, pNFS
drivers, NFS ACL modes, filesystem migration support, to name but a
few... knfsd lags behind in all these areas for a variety of reasons.

As for these particular features, they are of interest for Linux, not
just for interoperability reasons. With recent changes, Linux has
several filesystems that either are case insensitive, or can be
configured that way, so there should be an interest in having knfsd
support it. However I'm not going to volunteer either, because it's not
something I can commit my employer's resources towards doing at this
time.

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-01-03 22:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-17 20:36 [PATCH 0/5] Support case insensitive filesystems in NFSv4 trondmy
2021-12-17 20:36 ` [PATCH 1/5] NFSv4: Add some support for case insensitive filesystems trondmy
2021-12-17 20:36   ` [PATCH 2/5] NFSv4: Just don't cache negative dentries on case insensitive servers trondmy
2021-12-17 20:36     ` [PATCH 3/5] NFS: Invalidate negative dentries on all case insensitive directory changes trondmy
2021-12-17 20:36       ` [PATCH 4/5] NFS: Add a helper to remove case-insensitive aliases trondmy
2021-12-17 20:36         ` [PATCH 5/5] NFS: Fix the verifier for case sensitive filesystem in nfs_atomic_open() trondmy
2022-01-03 20:08 ` [PATCH 0/5] Support case insensitive filesystems in NFSv4 J. Bruce Fields
2022-01-03 20:11   ` Trond Myklebust
2022-01-03 21:46     ` bfields
2022-01-03 22:13       ` Trond Myklebust

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.