Skip to contentSkip to conversation

nfsd: fix handling of WANT_DELEG_TIMESTAMPS on open

PATCH In review Olga Kornievskaia 4 participants 7 messages Sep 20, 2024

Subsystems (2)
lore
Share & tools
lore

Olga Kornievskaia

author reviewer
#0 lore raw

PATCH 1/1 nfsd: fix handling of WANT_DELEG_TIMESTAMPS on open

Current, the server returns that it supports NFS4_SHARE_WANT_DELEG_TIMESTAMPS but when the client sends that on the open, knfsd returns back with bad_xdr error.

Fixes d0eab73d48a0 ("nfsd: add support for delegated timestamps")
---
 fs/nfsd/nfs4xdr.c | 1 +
 1 file changed, 1 insertion(+)
fs/nfsd/nfs4xdr.c +1 -0
index c0bad580ab6d..adda8b489175 100644
@@ -1109,6 +1109,7 @@ static __be32 nfsd4_decode_share_access(struct nfsd4_compoundargs *argp, u32 *sh
 	case NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED:
 	case (NFS4_SHARE_SIGNAL_DELEG_WHEN_RESRC_AVAIL |
 	      NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED):
+	case NFS4_SHARE_WANT_DELEG_TIMESTAMPS:
 		return nfs_ok;
 	}
 	return nfserr_bad_xdr;
Signature · 1 line
2.43.5
maintainer
#1 lore raw
Quoted 15 lines · Olga Kornievskaia

Current, the server returns that it supports NFS4_SHARE_WANT_DELEG_TIMESTAMPS but when the client sends that on the open, knfsd returns back with bad_xdr error.

Fixes d0eab73d48a0 ("nfsd: add support for delegated timestamps")
---
 fs/nfsd/nfs4xdr.c | 1 +
 1 file changed, 1 insertion(+)
fs/nfsd/nfs4xdr.c +0 -0
index c0bad580ab6d..adda8b489175 100644

fs/nfsd/nfs4xdr.c static __be32 nfsd4_decode_share_access(struct nfsd4_compoundargs *argp, u32 *sh · line 1115

Quoted 7 lines
fs/nfsd/nfs4xdr.c +1 -0
@@ -1109,6 +1109,7 @@ static __be32 nfsd4_decode_share_access(struct nfsd4_compoundargs *argp, u32 *sh
 	case NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED:
 	case (NFS4_SHARE_SIGNAL_DELEG_WHEN_RESRC_AVAIL |
 	      NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED):
+	case NFS4_SHARE_WANT_DELEG_TIMESTAMPS:
 		return nfs_ok;
 	}
 	return nfserr_bad_xdr;

Ouch.

The problem here is that we had to drop the patch that added OPEN_XOR_DELEGATION support. That patch reworked the flag handling in this function in a way that allowed the new delstid flags to be properly supported.

I think we probably want to resurrect the parts of this patch that alter nfsd4_decode_share_access:

https://lore.kernel.org/linux-nfs/[email protected]/

Olga, would you be OK with that approach instead?

Signature · 1 line
Jeff Layton <[email protected]>
#2 lore raw
Quoted 35 lines · Jeff Layton
Quoted 15 lines · Olga Kornievskaia

Current, the server returns that it supports NFS4_SHARE_WANT_DELEG_TIMESTAMPS but when the client sends that on the open, knfsd returns back with bad_xdr error.

Fixes d0eab73d48a0 ("nfsd: add support for delegated timestamps")

---
fs/nfsd/nfs4xdr.c | 1 +

1 file changed, 1 insertion(+)
fs/nfsd/nfs4xdr.c +0 -0
index c0bad580ab6d..adda8b489175 100644
@@ -1109,6 +1109,7 @@ static __be32 nfsd4_decode_share_access(struct nfsd4_compoundargs *argp, u32 *sh
Quoted 7 lines

case NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED:
case (NFS4_SHARE_SIGNAL_DELEG_WHEN_RESRC_AVAIL |
NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED):
+ case NFS4_SHARE_WANT_DELEG_TIMESTAMPS:
return nfs_ok;
}
return nfserr_bad_xdr;

Ouch.

The problem here is that we had to drop the patch that added OPEN_XOR_DELEGATION support. That patch reworked the flag handling in this function in a way that allowed the new delstid flags to be properly supported.

Quoted 6 lines

I think we probably want to resurrect the parts of this patch that alter nfsd4_decode_share_access:

https://lore.kernel.org/linux-nfs/[email protected]/

Olga, would you be OK with that approach instead?

At this point, I'd like to consider postponing the delstid patches until v6.13. They haven't gotten enough testing in their current form...

--
Chuck Lever

maintainer
#3 lore raw
Quoted 37 lines · Chuck Lever III
Quoted 37 lines · Jeff Layton
Quoted 15 lines · Olga Kornievskaia

Current, the server returns that it supports NFS4_SHARE_WANT_DELEG_TIMESTAMPS but when the client sends that on the open, knfsd returns back with bad_xdr error.

Fixes d0eab73d48a0 ("nfsd: add support for delegated timestamps")

---
fs/nfsd/nfs4xdr.c | 1 +

1 file changed, 1 insertion(+)
fs/nfsd/nfs4xdr.c +0 -0
index c0bad580ab6d..adda8b489175 100644
@@ -1109,6 +1109,7 @@ static __be32 nfsd4_decode_share_access(struct nfsd4_compoundargs *argp, u32 *sh
Quoted 7 lines

case NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED:
case (NFS4_SHARE_SIGNAL_DELEG_WHEN_RESRC_AVAIL |
NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED):
+ case NFS4_SHARE_WANT_DELEG_TIMESTAMPS:
return nfs_ok;
}
return nfserr_bad_xdr;

Ouch.

The problem here is that we had to drop the patch that added OPEN_XOR_DELEGATION support. That patch reworked the flag handling in this function in a way that allowed the new delstid flags to be properly supported.

I think we probably want to resurrect the parts of this patch that alter nfsd4_decode_share_access:

Quoted 8 lines
Quoted 3 lines

https://lore.kernel.org/linux-nfs/[email protected]/

Olga, would you be OK with that approach instead?

At this point, I'd like to consider postponing the delstid patches until v6.13. They haven't gotten enough testing in their current form...

It's your call, but that seems like an extreme reaction to a flag handling fix, given that we have several weeks of -rc's ahead of us.

Signature · 1 line
Jeff Layton <[email protected]>
#4 lore raw
Quoted 43 lines · Jeff Layton
Quoted 41 lines · Chuck Lever III
Quoted 40 lines · Jeff Layton
Quoted 15 lines · Olga Kornievskaia

Current, the server returns that it supports NFS4_SHARE_WANT_DELEG_TIMESTAMPS but when the client sends that on the open, knfsd returns back with bad_xdr error.

Fixes d0eab73d48a0 ("nfsd: add support for delegated timestamps")

---
fs/nfsd/nfs4xdr.c | 1 +

1 file changed, 1 insertion(+)
fs/nfsd/nfs4xdr.c +0 -0
index c0bad580ab6d..adda8b489175 100644
@@ -1109,6 +1109,7 @@ static __be32 nfsd4_decode_share_access(struct nfsd4_compoundargs *argp, u32 *sh
Quoted 7 lines

case NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED:
case (NFS4_SHARE_SIGNAL_DELEG_WHEN_RESRC_AVAIL |
NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED):
+ case NFS4_SHARE_WANT_DELEG_TIMESTAMPS:
return nfs_ok;
}
return nfserr_bad_xdr;

Ouch.

The problem here is that we had to drop the patch that added OPEN_XOR_DELEGATION support. That patch reworked the flag handling in this function in a way that allowed the new delstid flags to be properly supported.

I think we probably want to resurrect the parts of this patch that alter nfsd4_decode_share_access:

https://lore.kernel.org/linux-nfs/[email protected]/

Olga, would you be OK with that approach instead?

Quoted 7 lines
Quoted 4 lines

At this point, I'd like to consider postponing the delstid patches until v6.13. They haven't gotten enough testing in their current form...

It's your call, but that seems like an extreme reaction to a flag handling fix, given that we have several weeks of -rc's ahead of us.

I'm OK with whatever fix/approach it's going to go (Jeff if you have a patch to test that would go on top of what's in Chuck's nfsd-next and fixes the issue do post it) . I'm not ok with the code that's at the moment in nfsd-next :).

Quoted 3 lines

--
Jeff Layton <[email protected]>

#5 lore raw
In reply to Jeff Layton
Quoted 44 lines · Jeff Layton
Quoted 39 lines · Chuck Lever III
Quoted 39 lines · Jeff Layton
Quoted 15 lines · Olga Kornievskaia

Current, the server returns that it supports NFS4_SHARE_WANT_DELEG_TIMESTAMPS but when the client sends that on the open, knfsd returns back with bad_xdr error.

Fixes d0eab73d48a0 ("nfsd: add support for delegated timestamps")

---
fs/nfsd/nfs4xdr.c | 1 +

1 file changed, 1 insertion(+)
fs/nfsd/nfs4xdr.c +0 -0
index c0bad580ab6d..adda8b489175 100644
@@ -1109,6 +1109,7 @@ static __be32 nfsd4_decode_share_access(struct nfsd4_compoundargs *argp, u32 *sh
Quoted 7 lines

case NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED:
case (NFS4_SHARE_SIGNAL_DELEG_WHEN_RESRC_AVAIL |
NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED):
+ case NFS4_SHARE_WANT_DELEG_TIMESTAMPS:
return nfs_ok;
}
return nfserr_bad_xdr;

Ouch.

The problem here is that we had to drop the patch that added OPEN_XOR_DELEGATION support. That patch reworked the flag handling in this function in a way that allowed the new delstid flags to be properly supported.

I think we probably want to resurrect the parts of this patch that alter nfsd4_decode_share_access:

https://lore.kernel.org/linux-nfs/[email protected]/

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Olga, would you be OK with that approach instead?

At this point, I'd like to consider postponing the delstid patches until v6.13. They haven't gotten enough testing in their current form...

It's your call, but that seems like an extreme reaction to a flag handling fix, given that we have several weeks of -rc's ahead of us.

It's not just this small problem that worries me.

I pulled in v4 of the delstid patches pretty much at the last moment for v6.12 development. So far, there's been an 80% performance regression, and the surgery to work around that issue introduced another bug that invalidates all NFSv4.2 test results since that surgery, just a week ago.

The delstid patches impact an already heavily-used code path (OPEN). You've already found one or two bugs in the client side as well. This isn't something the can be disabled by distros until it is ready -- it's baked into a popular code path as soon as it goes upstream, and NFSv4.2 is the current default.

So I can't say with confidence that this code is stable and ready to merge. If we had another week or two before v6.11 final, there wouldn't be a question, but it's already a week into the v6.12 merge window, and I need to submit a pull request in the next few days. A 6.11-rc8 would have been extremely helpful, but we didn't get one.

Exposing this change set to the cauldron that is bake-a-thon would be valuable, IMO, for both the client and the server.

--
Chuck Lever

maintainer
#6 lore raw
Quoted 74 lines · Chuck Lever III
Quoted 43 lines · Jeff Layton
Quoted 39 lines · Chuck Lever III
Quoted 39 lines · Jeff Layton
Quoted 15 lines · Olga Kornievskaia

Current, the server returns that it supports NFS4_SHARE_WANT_DELEG_TIMESTAMPS but when the client sends that on the open, knfsd returns back with bad_xdr error.

Fixes d0eab73d48a0 ("nfsd: add support for delegated timestamps")

---
fs/nfsd/nfs4xdr.c | 1 +

1 file changed, 1 insertion(+)
fs/nfsd/nfs4xdr.c +0 -0
index c0bad580ab6d..adda8b489175 100644
@@ -1109,6 +1109,7 @@ static __be32 nfsd4_decode_share_access(struct nfsd4_compoundargs *argp, u32 *sh
Quoted 7 lines

case NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED:
case (NFS4_SHARE_SIGNAL_DELEG_WHEN_RESRC_AVAIL |
NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED):
+ case NFS4_SHARE_WANT_DELEG_TIMESTAMPS:
return nfs_ok;
}
return nfserr_bad_xdr;

Ouch.

The problem here is that we had to drop the patch that added OPEN_XOR_DELEGATION support. That patch reworked the flag handling in this function in a way that allowed the new delstid flags to be properly supported.

I think we probably want to resurrect the parts of this patch that alter nfsd4_decode_share_access:

https://lore.kernel.org/linux-nfs/[email protected]/

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Olga, would you be OK with that approach instead?

At this point, I'd like to consider postponing the delstid patches until v6.13. They haven't gotten enough testing in their current form...

It's your call, but that seems like an extreme reaction to a flag handling fix, given that we have several weeks of -rc's ahead of us.

It's not just this small problem that worries me.

I pulled in v4 of the delstid patches pretty much at the last moment for v6.12 development. So far, there's been an 80% performance regression, and the surgery to work around that issue introduced another bug that invalidates all NFSv4.2 test results since that surgery, just a week ago.

The delstid patches impact an already heavily-used code path (OPEN). You've already found one or two bugs in the client side as well. This isn't something the can be disabled by distros until it is ready -- it's baked into a popular code path as soon as it goes upstream, and NFSv4.2 is the current default.

So I can't say with confidence that this code is stable and ready to merge. If we had another week or two before v6.11 final, there wouldn't be a question, but it's already a week into the v6.12 merge window, and I need to submit a pull request in the next few days. A 6.11-rc8 would have been extremely helpful, but we didn't get one.

Quoted 3 lines

Exposing this change set to the cauldron that is bake-a-thon would be valuable, IMO, for both the client and the server.

Fair enough. These are not features that anyone is particularly clamoring for, so dropping them for now is fine. I'll plan to spin up a new set once I'm back from travel (another week or so).

Signature · 1 line
Jeff Layton <[email protected]>