lkml.org 
[lkml]   [2003]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] unused label (was: Re: If xdr_kmap() fails, we need to ensure that it unmaps all the pages, and returns)
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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:47    [W:0.041 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site