Skip to contentSkip to conversation

nfs: simplify and guarantee owner uniqueness.

PATCH NeilBrown 3 participants 5 messages Sep 19, 2024 – Sep 22, 2024 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

NeilBrown

author
#1 lore raw
Quoted 3 lines · Steven Price

Hi Neil,

(Dropping the list/others due to the attachment)

(re-adding others now - thanks for the attachment).

Quoted 4 lines

Attached, this is booting a kernel compiled from 00fd839ca761 ("nfs:
simplify and guarantee owner uniqueness.") which uses an NFS root with a Debian bullseye userspace.

This shows that the owner_id was always different - or almost always. Once it repeated we got an error because the seqid kept increasing. This is because the xdr encoding is broken.

Please apply this incremental patch and confirm that it works now.

Thanks,
NeilBrown

fs/nfs/nfs4xdr.c +1 -1
index 1aaf908acc5d..88bcbcba1381 100644
@@ -1429,7 +1429,7 @@ static inline void encode_openhdr(struct xdr_stream *xdr, const struct nfs_opena
 	*p++ = cpu_to_be32(28);
 	p = xdr_encode_opaque_fixed(p, "open id:", 8);
 	*p++ = cpu_to_be32(arg->server->s_dev);
-	xdr_encode_hyper(p, arg->id.uniquifier);
+	p = xdr_encode_hyper(p, arg->id.uniquifier);
 	xdr_encode_hyper(p, arg->id.create_time);
 }
 
Tested-by
#2 lore raw
Quoted 12 lines · NeilBrown
Quoted 3 lines · Steven Price

Hi Neil,

(Dropping the list/others due to the attachment)

(re-adding others now - thanks for the attachment).

Quoted 4 lines

Attached, this is booting a kernel compiled from 00fd839ca761 ("nfs:
simplify and guarantee owner uniqueness.") which uses an NFS root with a Debian bullseye userspace.

Quoted 5 lines

This shows that the owner_id was always different - or almost always. Once it repeated we got an error because the seqid kept increasing. This is because the xdr encoding is broken.

Please apply this incremental patch and confirm that it works now.

Thanks, I've tested the below and I don't see NFS errors any more.

Thanks,
Steve

Quoted 16 lines

Thanks,
NeilBrown

fs/nfs/nfs4xdr.c +1 -1
index 1aaf908acc5d..88bcbcba1381 100644
@@ -1429,7 +1429,7 @@ static inline void encode_openhdr(struct xdr_stream *xdr, const struct nfs_opena
 	*p++ = cpu_to_be32(28);
 	p = xdr_encode_opaque_fixed(p, "open id:", 8);
 	*p++ = cpu_to_be32(arg->server->s_dev);
-	xdr_encode_hyper(p, arg->id.uniquifier);
+	p = xdr_encode_hyper(p, arg->id.uniquifier);
 	xdr_encode_hyper(p, arg->id.create_time);
 }
 
author
#3 lore raw
Quoted 17 lines · Steven Price
Quoted 16 lines · NeilBrown
Quoted 3 lines · Steven Price

Hi Neil,

(Dropping the list/others due to the attachment)

(re-adding others now - thanks for the attachment).

Quoted 4 lines

Attached, this is booting a kernel compiled from 00fd839ca761 ("nfs:
simplify and guarantee owner uniqueness.") which uses an NFS root with a Debian bullseye userspace.

This shows that the owner_id was always different - or almost always. Once it repeated we got an error because the seqid kept increasing. This is because the xdr encoding is broken.

Quoted 5 lines
Quoted 1 line

Please apply this incremental patch and confirm that it works now.

Thanks, I've tested the below and I don't see NFS errors any more.

Thanks Steve.

Anna: could you please squash this fix in to the commit?
Jon: could you please confirm that this fixes your problem too.

Thanks,
NeilBrown

fs/nfs/nfs4xdr.c +1 -1
index 1aaf908acc5d..88bcbcba1381 100644
@@ -1429,7 +1429,7 @@ static inline void encode_openhdr(struct xdr_stream *xdr, const struct nfs_opena
 	*p++ = cpu_to_be32(28);
 	p = xdr_encode_opaque_fixed(p, "open id:", 8);
 	*p++ = cpu_to_be32(arg->server->s_dev);
-	xdr_encode_hyper(p, arg->id.uniquifier);
+	p = xdr_encode_hyper(p, arg->id.uniquifier);
 	xdr_encode_hyper(p, arg->id.create_time);
 }
maintainer Tested-by
#4 lore raw

Hi Neil,

Quoted 37 lines · NeilBrown
Quoted 17 lines · Steven Price
Quoted 16 lines · NeilBrown
Quoted 3 lines · Steven Price

Hi Neil,

(Dropping the list/others due to the attachment)

(re-adding others now - thanks for the attachment).

Quoted 4 lines

Attached, this is booting a kernel compiled from 00fd839ca761 ("nfs:
simplify and guarantee owner uniqueness.") which uses an NFS root with a Debian bullseye userspace.

This shows that the owner_id was always different - or almost always. Once it repeated we got an error because the seqid kept increasing. This is because the xdr encoding is broken.

Quoted 5 lines
Quoted 1 line

Please apply this incremental patch and confirm that it works now.

Thanks, I've tested the below and I don't see NFS errors any more.

Thanks Steve.

Anna: could you please squash this fix in to the commit?
Jon: could you please confirm that this fixes your problem too.

Thanks,
NeilBrown

fs/nfs/nfs4xdr.c +0 -0
index 1aaf908acc5d..88bcbcba1381 100644

fs/nfs/nfs4xdr.c static inline void encode_openhdr(struct xdr_stream *xdr, const struct nfs_opena · line 1434

Quoted 7 lines
fs/nfs/nfs4xdr.c +1 -1
@@ -1429,7 +1429,7 @@ static inline void encode_openhdr(struct xdr_stream *xdr, const struct nfs_opena
  	*p++ = cpu_to_be32(28);
  	p = xdr_encode_opaque_fixed(p, "open id:", 8);
  	*p++ = cpu_to_be32(arg->server->s_dev);
-	xdr_encode_hyper(p, arg->id.uniquifier);
+	p = xdr_encode_hyper(p, arg->id.uniquifier);
  	xdr_encode_hyper(p, arg->id.create_time);
  }

Works for me!

Thanks
Jon

Signature · 1 line
nvpublic
author
#5 lore raw
Quoted 35 lines · Jon Hunter

Hi Neil,

Quoted 32 lines · NeilBrown
Quoted 17 lines · Steven Price
Quoted 16 lines · NeilBrown
Quoted 3 lines · Steven Price

Hi Neil,

(Dropping the list/others due to the attachment)

(re-adding others now - thanks for the attachment).

Quoted 4 lines

Attached, this is booting a kernel compiled from 00fd839ca761 ("nfs:
simplify and guarantee owner uniqueness.") which uses an NFS root with a Debian bullseye userspace.

This shows that the owner_id was always different - or almost always. Once it repeated we got an error because the seqid kept increasing. This is because the xdr encoding is broken.

Quoted 5 lines
Quoted 1 line

Please apply this incremental patch and confirm that it works now.

Thanks, I've tested the below and I don't see NFS errors any more.

Thanks Steve.

Anna: could you please squash this fix in to the commit?
Jon: could you please confirm that this fixes your problem too.

Thanks,
NeilBrown

Quoted 15 lines

fs/nfs/nfs4xdr.c static inline void encode_openhdr(struct xdr_stream *xdr, const struct nfs_opena · line 1434

Quoted 12 lines
fs/nfs/nfs4xdr.c +1 -1
index 1aaf908acc5d..88bcbcba1381 100644
@@ -1429,7 +1429,7 @@ static inline void encode_openhdr(struct xdr_stream *xdr, const struct nfs_opena
  	*p++ = cpu_to_be32(28);
  	p = xdr_encode_opaque_fixed(p, "open id:", 8);
  	*p++ = cpu_to_be32(arg->server->s_dev);
-	xdr_encode_hyper(p, arg->id.uniquifier);
+	p = xdr_encode_hyper(p, arg->id.uniquifier);
  	xdr_encode_hyper(p, arg->id.create_time);
  }

Works for me!

Thanks Jon.
Anna has updated the patch so the fixed version is what will land upstream.

NeilBrown