Re: NFS: Arghhh, stuck RPC requests!

Trond Myklebust (trond.myklebust@fys.uio.no)
Sat, 2 Jan 1999 18:41:08 +0100 (CET)


Hi Linus,

There remains a small race problem in 2.2.0-pre3 concerning NFS
deletions. Currently, 'remove_write_request' is called in routine
'free_write_request', which is only called after the dput of the
dentry in 'nfs_wback_result'. This means that the inode is sometimes
attempted deleted before its write queue has been cleared. This causes
the stuck RPC requests reported by, amongst others, Steffen Zahn.

Please find the appended patch to fs/nfs/write.c, that moves the call
to 'remove_write_request' to nfs_wback_result. There seems to be no
code that relies on the old behaviour, so this should be safe and it
is better than my earlier patch (which moved the dput to
free_write_request) since it allows us to continue to free the dentry
before the request wait queue is served.

Cheers,
Trond

--- linux/fs/nfs/write.c-2.2.0-pre3 Fri Dec 18 00:54:25 1998
+++ linux/fs/nfs/write.c Sat Jan 2 17:50:48 1999
@@ -263,12 +263,8 @@
static inline void
free_write_request(struct nfs_wreq * req)
{
- if (!--req->wb_count) {
- struct inode *inode = req->wb_inode;
- remove_write_request(&NFS_WRITEBACK(inode), req);
+ if (!--req->wb_count)
kfree(req);
- nr_write_requests--;
- }
}

/*
@@ -698,6 +694,8 @@
clear_bit(PG_uptodate, &page->flags);

__free_page(page);
+ remove_write_request(&NFS_WRITEBACK(inode), req);
+ nr_write_requests--;
dput(req->wb_dentry);

wake_up(&req->wb_wait);

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