Re: knfsd and ext2? Huh?

From: Trond Myklebust (trond.myklebust@fys.uio.no)
Date: Mon Jun 12 2000 - 11:18:34 EST


>>>>> " " == Alexei I Adamovich <lexa@adam.botik.ru> writes:

> I'm not shure if prune_dcache stuff is in 2.4.0-test1, but I
> definitely saw some Neil's stuff in (BTW: I very like it, it
> opens some way to filesystem-specific nfsd support).

prune_dcache is in albeit in a slightly cleaner form (Al put a more
generic solution into the VFS).

What is not in 2.4.0-test1 is the inode i_count SMP race stuff. Please
try out the ac-15 patch and see if that helps. Alternatively, please
check if the following patch (which should also fix the inode race but
only for the NFS client).

There are also a couple of other minor SMP race fixes that should go
in to the final 2.4.0. I haven't sent them to Alan, but perhaps I
should...

Cheers,
  Trond

diff -u --recursive --new-file linux-2.3.99-pre10-3/fs/nfs/flushd.c linux-2.3.99-pre10-3-igrab/fs/nfs/flushd.c
--- linux-2.3.99-pre10-3/fs/nfs/flushd.c Thu May 25 10:55:49 2000
+++ linux-2.3.99-pre10-3-igrab/fs/nfs/flushd.c Sat Jun 10 10:50:52 2000
@@ -161,9 +161,14 @@
         struct nfs_reqlist *cache = NFS_REQUESTLIST(inode);
         struct inode **q;
 
+ /* Note: we increase the inode i_count in order to prevent
+ * it from disappearing when on the flush list
+ */
+ if (!(inode = igrab(inode)))
+ return;
         spin_lock(&nfs_flushd_lock);
         if (NFS_FLAGS(inode) & NFS_INO_FLUSH)
- goto out;
+ goto out_iput;
         inode->u.nfs_i.hash_next = NULL;
 
         q = &cache->inodes;
@@ -171,13 +176,12 @@
                 q = &(*q)->u.nfs_i.hash_next;
         *q = inode;
 
- /* Note: we increase the inode i_count in order to prevent
- * it from disappearing when on the flush list
- */
         NFS_FLAGS(inode) |= NFS_INO_FLUSH;
- inode->i_count++;
- out:
         spin_unlock(&nfs_flushd_lock);
+ return;
+ out_iput:
+ spin_unlock(&nfs_flushd_lock);
+ iput(inode);
 }
 
 void inode_remove_flushd(struct inode *inode)
diff -u --recursive --new-file linux-2.3.99-pre10-3/fs/nfs/inode.c linux-2.3.99-pre10-3-igrab/fs/nfs/inode.c
--- linux-2.3.99-pre10-3/fs/nfs/inode.c Thu May 25 10:55:49 2000
+++ linux-2.3.99-pre10-3-igrab/fs/nfs/inode.c Sat Jun 10 10:49:35 2000
@@ -870,7 +870,8 @@
         int error;
         if (!(NFS_FLAGS(inode) & flag))
                 return 0;
- inode->i_count++;
+ if (!(inode = igrab(inode)))
+ return -EIO;
         error = nfs_wait_event(clnt, inode->i_wait, !(NFS_FLAGS(inode) & flag));
         iput(inode);
         return error;

-
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/



This archive was generated by hypermail 2b29 : Thu Jun 15 2000 - 21:00:25 EST