Skip to contentSkip to conversation

NFSD: fix bug for readdir of pseudofs

PATCH In review Kinglong Mee 2 participants 2 messages Jun 13, 2014 – Jun 17, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NFSD: fix bug for readdir of pseudofs

Commit 561f0ed498ca (nfsd4: allow large readdirs) introduces a bug about readdir the root of pseudofs.

Call xdr_truncate_encode() revert encoded name when skipping.

---
 fs/nfsd/nfs4xdr.c | 1 +
 1 file changed, 1 insertion(+)
fs/nfsd/nfs4xdr.c +1 -0
index 53ca43c..30913c8 100644
@@ -2687,6 +2687,7 @@ nfsd4_encode_dirent(void *ccdv, const char *name, int namlen,
 		nfserr = nfserr_toosmall;
 		goto fail;
 	case nfserr_noent:
+		xdr_truncate_encode(xdr, start_offset);
 		goto skip_entry;
 	default:
 		/*
Signature · 1 line
1.9.3
#1 lore raw
Quoted 4 lines · Kinglong Mee

Commit 561f0ed498ca (nfsd4: allow large readdirs) introduces a bug about readdir the root of pseudofs.

Call xdr_truncate_encode() revert encoded name when skipping.

Thanks for the fix! Applying for 3.16.

--b.

Quoted 21 lines
---
 fs/nfsd/nfs4xdr.c | 1 +
 1 file changed, 1 insertion(+)
fs/nfsd/nfs4xdr.c +1 -0
index 53ca43c..30913c8 100644
@@ -2687,6 +2687,7 @@ nfsd4_encode_dirent(void *ccdv, const char *name, int namlen,
 		nfserr = nfserr_toosmall;
 		goto fail;
 	case nfserr_noent:
+		xdr_truncate_encode(xdr, start_offset);
 		goto skip_entry;
 	default:
 		/*
Signature · 1 line
1.9.3