linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Trond Myklebust <trond.myklebust@fys.uio.no>,
	Marcelo Tosatti <marcelo@conectiva.com.br>
Cc: Linux Kernel Development <linux-kernel@vger.kernel.org>
Subject: [PATCH] unused label (was: Re: If xdr_kmap() fails, we need to ensure that it unmaps all the pages, and returns)
Date: Wed, 13 Aug 2003 12:29:29 +0200 (MEST)	[thread overview]
Message-ID: <Pine.GSO.4.21.0308131226370.11378-100000@vervain.sonytel.be> (raw)
In-Reply-To: <200307311703.h6VH3i0f027629@hera.kernel.org>

On Tue, 29 Jul 2003, Linux Kernel Mailing List wrote:
> ChangeSet 1.1019.1.22, 2003/07/30 01:54:20+02:00, trond.myklebust@fys.uio.no
> 
> 	If xdr_kmap() fails, we need to ensure that it unmaps all the pages, and returns
> 	0. We don't want to be sending partial RPC requests to the server.

> diff -Nru a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c
> --- a/net/sunrpc/xdr.c	Thu Jul 31 10:03:47 2003
> +++ b/net/sunrpc/xdr.c	Thu Jul 31 10:03:47 2003

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

After this change the label `out' becomes unused, causing a compile warning.
Here's a fix:

--- linux-2.4.22-rc2/net/sunrpc/xdr.c.orig	Wed Aug 13 12:03:03 2003
+++ linux-2.4.22-rc2/net/sunrpc/xdr.c	Wed Aug 13 12:21:11 2003
@@ -231,7 +231,6 @@
 		iov->iov_base = (char *)xdr->tail[0].iov_base + base;
 		iov++;
 	}
- out:
 	return (iov - iov_base);
 out_err:
 	for (; first_kmap != ppage; first_kmap++)

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


           reply	other threads:[~2003-08-13 10:29 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <200307311703.h6VH3i0f027629@hera.kernel.org>]

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=Pine.GSO.4.21.0308131226370.11378-100000@vervain.sonytel.be \
    --to=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --cc=trond.myklebust@fys.uio.no \
    --subject='[PATCH] unused label (was: Re: If xdr_kmap() fails, we need to ensure that it unmaps all the pages, and returns)' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).