NFS: Detect loops in a readdir due to bad cookies

Some filesystems (such as ext4) can return the same cookie value for
multiple files.  If we try to start a readdir with one of these cookies,
the server will return the first file found with a cookie of the same
value.  This can cause the client to enter an infinite loop.

Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
Bryan Schumaker 2011-03-23 15:04:31 -04:00 committed by Trond Myklebust
parent 480c2006eb
commit 8ef2ce3e16
2 changed files with 29 additions and 1 deletions

View file

@ -100,6 +100,8 @@ struct nfs_open_context {
struct nfs_open_dir_context {
struct rpc_cred *cred;
__u64 dir_cookie;
__u64 dup_cookie;
int duped;
};
/*