[Pvfs2-cvs] commit by pcarns in pvfs2-1/src/kernel/linux-2.6:
dcache.c
CVS commit program
cvs at parl.clemson.edu
Fri Feb 1 12:03:41 EST 2008
Update of /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6
In directory parlweb1:/tmp/cvs-serv6783/src/kernel/linux-2.6
Modified Files:
dcache.c
Log Message:
more dcache changes: what's the worst that could happen? :-)
Toning down the d_delete function so that it only throws away entries that
have a bad inode. Updated the revalidate path to mark inodes bad when a
revalidation fails. This should work fine for the simul test case, and also
leaves inodes alone if we don't specifically know of anything wrong with them.
Our NFS re-exporting ability right now is dependent on good inodes not
disappearing out from under knfsd. knfsd drops file references and expects
to be able to re-get them later based on inode number. The inode number is
only 32 bits and not sufficient for PVFS to reliably locate the file handle.
The normal solution is to implement vfs export ops (which allow you
to use identifiers more sophisticated than inode number), but this
would be really hard because of difficulty in finding directory parents
in PVFS.
Index: dcache.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6/dcache.c,v
diff -p -u -r1.37 -r1.38
--- dcache.c 23 Jan 2008 19:48:30 -0000 1.37
+++ dcache.c 1 Feb 2008 17:03:41 -0000 1.38
@@ -78,6 +78,10 @@ static int pvfs2_d_revalidate_common(str
{
gossip_debug(GOSSIP_DCACHE_DEBUG, "pvfs2_d_revalidate_common: lookup failure or no match.\n");
op_release(new_op);
+ /* mark the inode as bad so that d_delete will be aggressive
+ * about dropping the dentry
+ */
+ pvfs2_make_bad_inode(inode);
return(0);
}
@@ -104,7 +108,16 @@ static int pvfs2_d_revalidate_common(str
static int pvfs2_d_delete (struct dentry * dentry)
{
gossip_debug(GOSSIP_DCACHE_DEBUG, "pvfs2_d_delete: called on dentry %p.\n", dentry);
- return 1;
+ if(dentry->d_inode && is_bad_inode(dentry->d_inode))
+ {
+ gossip_debug(GOSSIP_DCACHE_DEBUG, "pvfs2_d_delete: returning 1 (bad inode).\n");
+ return 1;
+ }
+ else
+ {
+ gossip_debug(GOSSIP_DCACHE_DEBUG, "pvfs2_d_delete: returning 0 (inode looks ok).\n");
+ return 0;
+ }
}
/* should return 1 if dentry can still be trusted, else 0 */
More information about the Pvfs2-cvs
mailing list