Re: 2.1.117 NFS Oops

Jes Sorensen (Jes.Sorensen@cern.ch)
21 Aug 1998 09:49:29 +0200


>>>>> "Alan" == Alan Cox <alan@lxorguk.ukuu.org.uk> writes:

>> Which I believe corresponds to the following piece of code from
>> fs/nfs/write.c:

Alan> It does here

>> looks like someone clears the inode pointer stored in req->wb_inode
>> during the schedule()? Thus the reference to the inode in the
>> NFS_CLIENT macro will reference a bogus NULL pointer.

Alan> Yes. I belive you are right. Save the NFS_CLIENT() value at the
Alan> top of the code and reuse the saved pointer at the end.

Ok here is a patch, it compiles and I can mount stuff via NFS on my
Linux/m68k box - haven't tried NFS root or one of the x86 SMP boxes
yet.

Jes

--- native-2.1.117/fs/nfs/write.c Fri Aug 21 09:32:11 1998
+++ linux/fs/nfs/write.c Fri Aug 21 09:33:22 1998
@@ -469,8 +469,9 @@
struct page *page = req->wb_page;
int retval;
sigset_t oldmask;
+ struct rpc_clnt *clnt = NFS_CLIENT(req->wb_inode);

- rpc_clnt_sigmask(NFS_CLIENT(req->wb_inode), &oldmask);
+ rpc_clnt_sigmask(clnt, &oldmask);
add_wait_queue(&page->wait, &wait);
atomic_inc(&page->count);
for (;;) {
@@ -488,7 +489,7 @@
current->state = TASK_RUNNING;
/* N.B. page may have been unused, so we must use free_page() */
free_page(page_address(page));
- rpc_clnt_sigunmask(NFS_CLIENT(req->wb_inode), &oldmask);
+ rpc_clnt_sigunmask(clnt, &oldmask);
return retval;
}

-
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