Re: NFS + SMP == file corruption? patch (and further questions)

Trond Myklebust (trond.myklebust@fys.uio.no)
20 Nov 1998 03:01:33 +0100


--Multipart_Fri_Nov_20_03:01:33_1998-1
Content-Type: text/plain; charset=US-ASCII

Hi,

I think I've solved (part of) the NFS problem. In fact it wasn't an
SMP problem at all. It seems the calls to 'nfs_inval' that were
recently introduced to 'inode.c' are the main culprits.

I also removed the jiffy-based timeout on nfs_revalidate_inode and
_nfs_revalidate_inode. Are they really necessary now that the page
cache seems to be working?

I still have a majon problem with SMP on kernel 2.1.129 though: lots
of dead processes and the like. It looks (at 3 o'clock in the morning)
as though the sunrpc backlog queue is getting seriously congested. Has
anybody looked at this (and understood it 8-) ?

Cheers,
Trond

--Multipart_Fri_Nov_20_03:01:33_1998-1
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="patch-nfs-2.1.129.dif"
Content-Transfer-Encoding: 7bit

--- fs/nfs/inode.c-2.1.129 Thu Nov 19 18:15:48 1998
+++ fs/nfs/inode.c Fri Nov 20 00:17:52 1998
@@ -105,7 +105,7 @@
#ifdef NFS_DEBUG_VERBOSE
printk("nfs_delete_inode: inode %ld has pending RPC requests\n", inode->i_ino);
#endif
- nfs_inval(inode);
+ nfs_wbinval(inode);
while (NFS_WRITEBACK(inode) != NULL &&
time_before(jiffies, timeout)) {
current->state = TASK_INTERRUPTIBLE;
@@ -576,6 +576,9 @@
/*
* Make sure the inode is up-to-date.
*/
+ error = nfs_wb_all(inode);
+ if (error)
+ goto out;
error = nfs_revalidate(dentry);
if (error) {
#ifdef NFS_PARANOIA
@@ -655,10 +658,6 @@
int status = 0;
struct nfs_fattr fattr;

- /* Don't bother revalidating if we've done it recently */
- if (jiffies - NFS_READTIME(inode) < NFS_ATTRTIMEO(inode))
- goto out;
-
dfprintk(PAGECACHE, "NFS: revalidating %s/%s, ino=%ld\n",
dentry->d_parent->d_name.name, dentry->d_name.name,
inode->i_ino);
@@ -827,7 +826,7 @@
if (!S_ISDIR(inode->i_mode)) {
/* This sends off all dirty pages off to the server.
* Note that this function must not sleep. */
- nfs_inval(inode);
+ nfs_wbinval(inode);
invalidate_inode_pages(inode);
} else
nfs_invalidate_dircache(inode);
--- include/linux/nfs_fs.h-2.1.129 Thu Nov 19 16:35:08 1998
+++ include/linux/nfs_fs.h Thu Nov 19 18:58:29 1998
@@ -253,9 +253,6 @@
static inline int
nfs_revalidate_inode(struct nfs_server *server, struct dentry *dentry)
{
- struct inode *inode = dentry->d_inode;
- if (jiffies - NFS_READTIME(inode) < NFS_ATTRTIMEO(inode))
- return 0;
return _nfs_revalidate_inode(server, dentry);
}

--Multipart_Fri_Nov_20_03:01:33_1998-1--

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