Skip to contentSkip to conversation

unused label (was: Re: If xdr_kmap() fails, we need to ensure that it unmaps all the pages, and returns)

PATCH New Geert Uytterhoeven 1 participant 1 message Aug 13, 2003 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#1 lore raw

PATCH 1/1 unused label (was: Re: If xdr_kmap() fails, we need to ensure that it unmaps all the pages, and returns)

In reply to a message not in the archive
Quoted 19 lines · Linux Kernel Mailing List

ChangeSet 1.1019.1.22, 2003/07/30 01:54:20+02:00, [email protected]

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

net/sunrpc/xdr.c +1 -3
@@ -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) {

net/sunrpc/xdr.c line 218

Quoted 10 lines
net/sunrpc/xdr.c +2 -1
+			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:

net/sunrpc/xdr.c renamed from net/sunrpc/xdr.c.orig +0 -1
@@ -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 -- [email protected]

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