All of lore.kernel.org
 help / color / mirror / Atom feed
* NFS dentry caching mechanism
@ 2006-01-26 22:40 Usha Ketineni
  2006-01-26 23:14 ` Trond Myklebust
  0 siblings, 1 reply; 11+ messages in thread
From: Usha Ketineni @ 2006-01-26 22:40 UTC (permalink / raw)
  To: nfs

[-- Attachment #1: Type: text/plain, Size: 1608 bytes --]

We are investigating an issue with the NFS client code in 2.4.21 kernel:

To reproduce the issue:

(using machine A and machine B, and a file system mounted off an NFS 
server 
called /home)

1) On Machine A: 

ls home/source 
ls: /home/source: No such file or directory 

2) On machine B: 
touch /home/source 

3) back on machine A: 
rm /home/source 
rm: cannot lstat `source': No such file or directory 

But source *does* exist. 

This shows the problem.

===

There are workarounds:

1) Mount the file system with acdirmin=0 and acdirmax=0. But this then 
affects 
all system calls, not just unlink(). And it hurts NFS performance.

2) Mount the file system with the noac option, but the same negative 
effect as 
in #1 applies.

What happens is this: 

0) Let F be a filename on the NFS file system. Initially this file
does not exist.

1) The application on the machine A does a stat() on F. The NFS
client in the kernel sends a LOOKUP request to the NFS server, which
obviously returns failure. The stat() fails with ENOENT. OK so far.

2) Immediately afterwards (a few seconds max), the application on
machine B creates the file F. No problems so far.

3) When B is done with F, a few seconds later the application on
machine A does an unlink() on F. Because of the negative dentry
caching in the Linux kernel, it doesn't even bother to send an NFS
REMOVE request to the NFS server, as (it thinks) it knows for sure the
file doesn't exist. It lets the unlink() fail with ENOENT. But the
file definitely exists.

Is there any other solution for this (including moving to a newer kernel)?


Thanks
Usha

[-- Attachment #2: Type: text/html, Size: 2198 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2006-01-27 18:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-26 22:40 NFS dentry caching mechanism Usha Ketineni
2006-01-26 23:14 ` Trond Myklebust
2006-01-27 13:38   ` Peter Staubach
2006-01-27 13:44     ` Trond Myklebust
2006-01-27 13:49       ` Peter Staubach
2006-01-27 14:26         ` Trond Myklebust
2006-01-27 14:43           ` Peter Staubach
2006-01-27 15:13             ` Trond Myklebust
2006-01-27 15:36               ` Peter Staubach
2006-01-27 17:13                 ` Trond Myklebust
2006-01-27 18:20                   ` Peter Staubach

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.