[Lustre-devel] open(), getattr(), and negative dentries
John Hammond
jhammond at tacc.utexas.edu
Mon Aug 1 09:10:15 PDT 2011
On 07/27/2011 12:02 AM, Oleg Drokin wrote:
> Hello!
>
> On Jul 21, 2011, at 4:15 PM, John Hammond wrote:
>
>> It appears that stating a non-existent file on Lustre causes a negative
>> dentry to be created, while opening it does not. If I understand
>> correctly, this also means that every open of a non-existent file that
>> misses the dentry cache causes an RPC to the MDS. Is there a reason for
>> the difference?
>
> Open does not return a parent dir lock back to the client and this is what guards
> negative dentries.
> So if you do ls -l on the dir, and then do your open (without O_CREATE!)
> the negative dentry will be cached because of the pre-existing lock.
> In fact is the dir was last modified sufficiently long ago (like several seconds have passed),
> even lookup of the dir itself (even done as part of the path lookup to the filename)
> would return you the needed lock and negative dentry will be cached.
Thanks, that's helpful. I assume that "sufficiently long ago" means
after ns_ctime_age_limit (10 by default) seconds have passed. I
adjusted my test case to account for this but there still seems to be an
issue here, so I created LU-560.
Best,
John
--
John L. Hammond, Ph.D.
TACC, The University of Texas at Austin
jhammond at tacc.utexas.edu
(512) 471-9304
More information about the lustre-devel
mailing list