lkml.org 
[lkml]   [1999]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patches in this message
/
Date
SubjectNFS and negative dcache entries...
From
>>>>> " " == Steve Mcclure <smcclure@emc.com> writes:

> Hello. I've found my problem, or at least a solution to it.
> It's negative dcache entry cacheing. I have a simple fix that
> I'd like to see implemented. Note that this is against the
> 2.2.10 kernel, but I believe it exists in the 2.2.11 and others
> from some of the traffic I'm seeing.

> Basically, when I mount with the "noac" option, I expect all
> attribute caching to be disabled, including negative dcache
> entries. So, this simple fix below does that, and solves my
> problems I'm having in this area (strange NFS "things". :) )

> -- Steve McClure
> smcclure@emc.com

> ----

> --- dir.c.orig Sun Aug 22 12:07:21 1999
> +++ dir.c Mon Aug 23 21:06:49 1999
> @@ -402,6 +402,8 @@ static inline int nfs_neg_need_reval(str

> if (diff < 5*60)
> timeout = 1 * HZ;
> + if (timeout > NFS_ATTRTIMEO(dentry->d_parent->d_inode))
> + timeout = NFS_ATTRTIMEO(dentry->d_parent->d_inode);
> return time_after(jiffies, dentry->d_time + timeout);
> }
This is a similar sort of thing to what I've been testing out lately
in the NFSv3 patches (following Frank van Maarseveen's suggestion on
linux-kernel). I include it for comparison purposes. It seems to me
like the right sort of approach for this issue since it gets rid of
the arbitrary limit for revalidation, and fulfills the expectations of
people mounting with 'noac' or acdirmin = 0.

Of course, NFS being a stateless filesystem means that relying on this
--especially for file locking issues etc-- is a bug.

Cheers,
Trond

--- linux-2.2.11/fs/nfs/dir.c.orig Mon Aug 9 21:04:57 1999
+++ linux-2.2.11/fs/nfs/dir.c Tue Aug 24 14:28:54 1999
@@ -395,13 +395,14 @@
* If mtime is close to present time, we revalidate
* more often.
*/
+#define NFS_REVALIDATE_NEGATIVE (1 * HZ)
static inline int nfs_neg_need_reval(struct dentry *dentry)
{
- unsigned long timeout = 30 * HZ;
+ unsigned long timeout = NFS_ATTRTIMEO(dentry->d_parent->d_inode);
long diff = CURRENT_TIME - dentry->d_parent->d_inode->i_mtime;

- if (diff < 5*60)
- timeout = 1 * HZ;
+ if (diff < 5*60 && timeout > NFS_REVALIDATE_NEGATIVE)
+ timeout = NFS_REVALIDATE_NEGATIVE;

return time_after(jiffies, dentry->d_time + timeout);
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.152 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site