Message ID | 20121114160808.GH23604@fieldses.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
J. Bruce Fields schrieb am Mittwoch, den 14. November um 17:08 Uhr: > commit 8688bcb10bd006111b1b46c23a27081ea359e140 > Author: J. Bruce Fields <bfields@redhat.com> > Date: Wed Nov 14 10:48:05 2012 -0500 > > svcrpc: Revert "sunrpc/cache.h: replace simple_strtoul" > > Commit bbf43dc888833ac0539e437dbaeb28bfd4fbab9f "sunrpc/cache.h: replace > simple_strtoul" introduced new range-checking which could cause get_int > to fail on unsigned integers to large to be represented as an int. > > We could parse them as unsigned instead--but it turns out svcgssd is > actually passing down "-1" in some cases. Which is perhaps stupid, but > there's nothing we can do about it now. > > So just revert back to the previous "sloppy" behavior that accepts > either representation. > > Signed-off-by: J. Bruce Fields <bfields@redhat.com> > > diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h > index f792794..5dc9ee4 100644 > --- a/include/linux/sunrpc/cache.h > +++ b/include/linux/sunrpc/cache.h > @@ -217,6 +217,8 @@ extern int qword_get(char **bpp, char *dest, int bufsize); > static inline int get_int(char **bpp, int *anint) > { > char buf[50]; > + char *ep; > + int rv; > int len = qword_get(bpp, buf, sizeof(buf)); > > if (len < 0) > @@ -224,9 +226,11 @@ static inline int get_int(char **bpp, int *anint) > if (len == 0) > return -ENOENT; > > - if (kstrtoint(buf, 0, anint)) > + rv = simple_strtol(buf, &ep, 0); > + if (*ep) > return -EINVAL; > > + *anint = rv; > return 0; > } OK, so this can be marked as resolved (for now) on my todo list, right? Will this go into 3.6.7 and of course 3.7? Sven
On Thu, Nov 15, 2012 at 05:58:24PM +0100, Sven Geggus wrote: > OK, so this can be marked as resolved (for now) on my todo list, right? Will > this go into 3.6.7 and of course 3.7? Yep, I'll pass this along by next week. --b. -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
J. Bruce Fields <bfields@fieldses.org> wrote: >> OK, so this can be marked as resolved (for now) on my todo list, right? Will >> this go into 3.6.7 and of course 3.7? > > Yep, I'll pass this along by next week. As 3.7 has been relased now: It looks like the unreverted Version is still present in Linux 3.7.0 as well as 3.6.10 While it is easy enough to use "git revert bbf43dc888833ac0539e437dbaeb28bfd4fbab9f" I would rather be able to use vanilla kernels again. Regards Sven
Please don't drop me off the cc: line. On Wed, Dec 12, 2012 at 11:15:27AM +0000, Sven Geggus wrote: > J. Bruce Fields <bfields@fieldses.org> wrote: > > >> OK, so this can be marked as resolved (for now) on my todo list, right? Will > >> this go into 3.6.7 and of course 3.7? > > > > Yep, I'll pass this along by next week. > > As 3.7 has been relased now: > > It looks like the unreverted Version is still present in Linux 3.7.0 as well > as 3.6.10 > > While it is easy enough to use > "git revert bbf43dc888833ac0539e437dbaeb28bfd4fbab9f" I would rather be able > to use vanilla kernels again. Right, apologies, I ended up deciding to hold that for the merge window. It's marked for stable so should make it into 3.7.x as well. --b. -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index f792794..5dc9ee4 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h @@ -217,6 +217,8 @@ extern int qword_get(char **bpp, char *dest, int bufsize); static inline int get_int(char **bpp, int *anint) { char buf[50]; + char *ep; + int rv; int len = qword_get(bpp, buf, sizeof(buf)); if (len < 0) @@ -224,9 +226,11 @@ static inline int get_int(char **bpp, int *anint) if (len == 0) return -ENOENT; - if (kstrtoint(buf, 0, anint)) + rv = simple_strtol(buf, &ep, 0); + if (*ep) return -EINVAL; + *anint = rv; return 0; }