All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Jean-Christophe Ducom <jducom@nd.edu>
Cc: nfs@lists.sourceforge.net
Subject: Re: NFS clients hang
Date: 11 Jul 2003 20:26:26 +0200	[thread overview]
Message-ID: <shshe5sudgt.fsf@charged.uio.no> (raw)
In-Reply-To: <3F0ECE77.1050703@nd.edu>

>>>>> " " == Jean-Christophe Ducom <jducom@nd.edu> writes:

     > So is this problem still around or is it specific to Xeons?

It was believed to be fixed in the final version of 2.4.21. Andrea
Archangeli made a patch that adds a non-blocking version of the kmap()
call.

Hmm... It all looks very wrong though: We certainly don't want to be
sending partial requests...
Does the following patch help?

Cheers,
  Trond

diff -u --recursive --new-file linux-2.4.22-pre4/net/sunrpc/xdr.c linux-2.4.22-fix_highmem/net/sunrpc/xdr.c
--- linux-2.4.22-pre4/net/sunrpc/xdr.c	2003-06-27 12:29:06.000000000 +0200
+++ linux-2.4.22-fix_highmem/net/sunrpc/xdr.c	2003-07-11 20:23:05.000000000 +0200
@@ -180,7 +180,8 @@
 {
 	struct iovec	*iov = iov_base;
 	struct page	**ppage = xdr->pages;
-	unsigned int	len, pglen = xdr->page_len, first_kmap;
+	struct page	**first_kmap = NULL;
+	unsigned int	len, pglen = xdr->page_len;
 
 	len = xdr->head[0].iov_len;
 	if (base < len) {
@@ -203,16 +204,15 @@
 		ppage += base >> PAGE_CACHE_SHIFT;
 		base &= ~PAGE_CACHE_MASK;
 	}
-	first_kmap = 1;
 	do {
 		len = PAGE_CACHE_SIZE;
-		if (first_kmap) {
-			first_kmap = 0;
+		if (!first_kmap) {
+			first_kmap = ppage;
 			iov->iov_base = kmap(*ppage);
 		} else {
 			iov->iov_base = kmap_nonblock(*ppage);
 			if (!iov->iov_base)
-				goto out;
+				goto out_err;
 		}
 		if (base) {
 			iov->iov_base += base;
@@ -233,6 +233,10 @@
 	}
  out:
 	return (iov - iov_base);
+out_err:
+	for (; first_kmap != ppage; first_kmap++)
+		kunmap(*first_kmap);
+	return 0;
 }
 
 void xdr_kunmap(struct xdr_buf *xdr, unsigned int base, int niov)
diff -u --recursive --new-file linux-2.4.22-pre4/net/sunrpc/xprt.c linux-2.4.22-fix_highmem/net/sunrpc/xprt.c
--- linux-2.4.22-pre4/net/sunrpc/xprt.c	2003-07-08 11:59:01.000000000 +0200
+++ linux-2.4.22-fix_highmem/net/sunrpc/xprt.c	2003-07-11 20:23:50.000000000 +0200
@@ -237,6 +237,10 @@
 		unsigned int slen_part, n;
 
 		niov = xdr_kmap(niv, xdr, skip);
+		if (!niov) {
+			result = -EAGAIN;
+			break;
+		}
 
 		msg.msg_flags   = MSG_DONTWAIT|MSG_NOSIGNAL;
 		msg.msg_iov	= niv;


-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

      reply	other threads:[~2003-07-11 18:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-11 14:49 NFS clients hang Jean-Christophe Ducom
2003-07-11 18:26 ` Trond Myklebust [this message]

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=shshe5sudgt.fsf@charged.uio.no \
    --to=trond.myklebust@fys.uio.no \
    --cc=jducom@nd.edu \
    --cc=nfs@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.