2004-09-01 22:26:47

by Suresh Gopalakrishnan

[permalink] [raw]
Subject: NFS returns EBADCOOKIE (523) to user space


When a process is doing a readdir in a directory and another process is
deleting objects in the same directory, sometimes EBADCOOKIE seems to be
returned to the first process.

The following messages were seen when nfs tracing was turned on.
kernel: NFS: find_dirent() returns -523
kernel: NFS: find_dirent_page() returns -523
kernel: NFS: readdir_search_pagecache() returned -523

Here is the analysis: In nfs_readdir, when readdir_search_pagecache()
returns -EBADCOOKIE, uncached_readdir() is called. This sets desc->error
to -EBADCOOKIE, and status to -EIO. In nfs_readdir(), the status (res) is
reset to 0. Then desc->error is returned as is to user space.

--suresh