Re: Another NFS testcase... patch proposal

Trond Myklebust (trond.myklebust@fys.uio.no)
Tue, 1 Sep 1998 20:17:22 +0200 (CEST)


Hi,

I believe this patch fixes a problem that exists when a page
flushing is interrupted (the problem I reported of ^C followed by
SIGKILL).

The problem is that 'nfs_find_dentry_request' is unaware of the
concept of cancelled write requests, and thus can cause an infinite
loop in 'nfs_dentry_iput'.

Does this sound reasonable to people?

Cheers,
Trond

--- linux/fs/nfs/write.c-2.1.119 Thu Aug 27 22:17:48 1998
+++ linux/fs/nfs/write.c Tue Sep 1 19:59:11 1998
@@ -1,4 +1,4 @@
-/*
+ /*
* linux/fs/nfs/write.c
*
* Writing file data over NFS.
@@ -61,6 +61,8 @@

static void nfs_wback_lock(struct rpc_task *task);
static void nfs_wback_result(struct rpc_task *task);
+static void nfs_cancel_request(struct nfs_wreq *req);
+

/*
* Cache parameters
@@ -248,7 +250,7 @@

req = head = NFS_WRITEBACK(inode);
while (req != NULL) {
- if (req->wb_dentry == dentry) {
+ if (req->wb_dentry == dentry && !WB_CANCELLED(req)) {
found = 1;
break;
}
@@ -585,8 +587,11 @@
transfer_page_lock(req);
/* rpc_execute(&req->wb_task); */
if (sync) {
- /* N.B. if signalled, result not ready? */
- wait_on_write_request(req);
+ /* if signalled, ensure request is cancelled */
+ if ((count = wait_on_write_request(req)) != 0) {
+ nfs_cancel_request(req);
+ status = count;
+ }
if ((count = nfs_write_error(inode)) < 0)
status = count;
}

-
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.altern.org/andrebalsa/doc/lkml-faq.html