linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] unused label (was: Re: If xdr_kmap() fails, we need to ensure that it unmaps all the pages, and returns)
       [not found] <200307311703.h6VH3i0f027629@hera.kernel.org>
@ 2003-08-13 10:29 ` Geert Uytterhoeven
  0 siblings, 0 replies; only message in thread
From: Geert Uytterhoeven @ 2003-08-13 10:29 UTC (permalink / raw)
  To: Trond Myklebust, Marcelo Tosatti; +Cc: Linux Kernel Development

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


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

only message in thread, other threads:[~2003-08-13 10:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200307311703.h6VH3i0f027629@hera.kernel.org>
2003-08-13 10:29 ` [PATCH] unused label (was: Re: If xdr_kmap() fails, we need to ensure that it unmaps all the pages, and returns) Geert Uytterhoeven

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