kNFSd - 7 of 8 - Fix byte counting for NFSv3 readdir replies
Subsystems (2)
PATCH 1/1 kNFSd - 7 of 8 - Fix byte counting for NFSv3 readdir replies
### Comments for ChangeSet
The amount of free space is calculated wrongly so nfsv3 readdir replies are shorted than they could be.
----------- Diffstat output ------------
./fs/nfsd/nfs3xdr.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
fs/nfsd/nfs3xdr.c renamed from fs/nfsd/nfs3xdr.c~current~ +3 -3
@@ -780,7 +780,7 @@ encode_entry(struct readdir_cd *ccd, con { struct nfsd3_readdirres *cd = container_of(ccd, struct nfsd3_readdirres, common);u32 *p = cd->buffer; -int buflen, slen, elen; +int slen, elen;if (cd->offset)xdr_encode_hyper (cd->offset, (u64 ) offset);
@@ -797,7 +797,7 @@ encode_entry(struct readdir_cd *ccd, con slen =XDR_QUADLEN (namlen); elen = slen +NFS3_ENTRY_BAGGAGE + (plus?NFS3_ENTRYPLUS_BAGGAGE :0 ); -if ((buflen = cd->buflen - elen) <0 ) { +if (cd->buflen < elen) { cd->common.err = nfserr_readdir_nospc;return -EINVAL ; }
@@ -836,7 +836,7 @@ encode_entry(struct readdir_cd *ccd, con } out: - cd->buflen = buflen; + cd->buflen -= p - cd->buffer; cd->buffer = p; cd->common.err = nfs_ok;return 0 ;
-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs