NFSD: fix bug for readdir of pseudofs
authorKinglong Mee <kinglongmee@gmail.com>
Fri, 13 Jun 2014 09:32:42 +0000 (17:32 +0800)
committerJ. Bruce Fields <bfields@redhat.com>
Tue, 17 Jun 2014 20:42:48 +0000 (16:42 -0400)
Commit 561f0ed498ca (nfsd4: allow large readdirs) introduces a bug
about readdir the root of pseudofs.

Call xdr_truncate_encode() revert encoded name when skipping.

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4xdr.c

index 2d305a121f3793685e81475c7b51b308d7af2dc4..83baf2bfe9e9c54642c738435fc771704c9fec3d 100644 (file)
@@ -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:
                /*