mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Another bug? linux/fs/nfs/write.c
       [not found] <20010521142400.A7229@cse.unsw.edu.au>
@ 2001-05-21 13:38 ` Trond Myklebust
  0 siblings, 0 replies; only message in thread
From: Trond Myklebust @ 2001-05-21 13:38 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Matt Chapman, Linux Kernel, NFS maillist


Linus,
  The following mail from Matt describes a problem in the NFS
read/write code that can cause a vicious hang. Obvious patch to fix it
is attached...

Cheers,
   Trond

>>>>> " " == Matt Chapman <matthewc@cse.unsw.edu.au> writes:

     > Trond, Here's another bug which seems to be causing crashes.

     > nfs_update_request keeps calling nfs_wait_on_request until the
     > request can be locked.  Presumably it's relying on
     > nfs_wait_on_request to schedule, and hence run rpciod to
     > retransmit any lost requests.  However, if the fs is mounted
     > with the intr option and a signal has arrived, then
     > nfs_wait_on_request (ultimately, wait_event_interruptible)
     > returns immediately with -ERESTARTSYS, and the loop spins.

     > Presumably nfs_update_request needs to check the return value
     > of nfs_wait_on_request and return right up the chain on
     > -ERESTARTSYS.  However, since I don't know this code very well,
     > I'd prefer it if you had a look at it and gave some advice.

diff -u --recursive --new-file linux-2.4.5-fixes/fs/nfs/write.c linux-2.4.5-write/fs/nfs/write.c
--- linux-2.4.5-fixes/fs/nfs/write.c	Mon May 21 11:34:51 2001
+++ linux-2.4.5-write/fs/nfs/write.c	Mon May 21 13:18:47 2001
@@ -863,9 +863,12 @@
 		req = _nfs_find_request(inode, page);
 		if (req) {
 			if (!nfs_lock_request(req)) {
+				int error;
 				spin_unlock(&nfs_wreq_lock);
-				nfs_wait_on_request(req);
+				error = nfs_wait_on_request(req);
 				nfs_release_request(req);
+				if (error < 0)
+					return ERR_PTR(error);
 				continue;
 			}
 			spin_unlock(&nfs_wreq_lock);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-05-21 13:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20010521142400.A7229@cse.unsw.edu.au>
2001-05-21 13:38 ` Another bug? linux/fs/nfs/write.c Trond Myklebust

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®