Commit d08a0a0e authored by Trond Myklebust's avatar Trond Myklebust Committed by Linus Torvalds

[PATCH] NFS: readdir reply truncated!

Duh... Even a simple one-liner test can be wrong. The really sad bit
is that I made the same mistake 3 weeks ago, fixed it, and then lost
track of the fix...

To recap fix to fix: A valid end of directory marker has to read
(entry[0]==0 && entry[1]!=0). Here is final correct (I hope) patch.
parent 2f210ce0
...@@ -434,7 +434,7 @@ nfs_xdr_readdirres(struct rpc_rqst *req, u32 *p, void *dummy) ...@@ -434,7 +434,7 @@ nfs_xdr_readdirres(struct rpc_rqst *req, u32 *p, void *dummy)
goto short_pkt; goto short_pkt;
entry = p; entry = p;
} }
if (!nr && (entry[0] != 0 || entry[1] != 1)) if (!nr && (entry[0] != 0 || entry[1] == 0))
goto short_pkt; goto short_pkt;
out: out:
kunmap(*page); kunmap(*page);
......
...@@ -579,7 +579,7 @@ nfs3_xdr_readdirres(struct rpc_rqst *req, u32 *p, struct nfs3_readdirres *res) ...@@ -579,7 +579,7 @@ nfs3_xdr_readdirres(struct rpc_rqst *req, u32 *p, struct nfs3_readdirres *res)
goto short_pkt; goto short_pkt;
entry = p; entry = p;
} }
if (!nr && (entry[0] != 0 || entry[1] != 1)) if (!nr && (entry[0] != 0 || entry[1] == 0))
goto short_pkt; goto short_pkt;
out: out:
kunmap(*page); kunmap(*page);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment