mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Matt Chapman <matthewc@cse.unsw.edu.au>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	NFS maillist <nfs@lists.sourceforge.net>
Subject: Another bug? linux/fs/nfs/write.c
Date: Mon, 21 May 2001 15:38:06 +0200	[thread overview]
Message-ID: <15113.6718.559887.978482@charged.uio.no> (raw)
In-Reply-To: <20010521142400.A7229@cse.unsw.edu.au>
In-Reply-To: <20010521142400.A7229@cse.unsw.edu.au>


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);

           reply	other threads:[~2001-05-21 13:38 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20010521142400.A7229@cse.unsw.edu.au>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15113.6718.559887.978482@charged.uio.no \
    --to=trond.myklebust@fys.uio.no \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthewc@cse.unsw.edu.au \
    --cc=nfs@lists.sourceforge.net \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®