Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 291978 Details for
Bug 429103
Allocations on resume path can cause deadlock due to attempting to swap
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
xen-unstable.hg 12562:c242b6d6a64a backported to 2.6.9-67.0.1.EL
xen-unstable-12562-c242b6d6a64a (text/plain), 8.76 KB, created by
Ian Campbell
on 2008-01-17 11:03:31 UTC
(
hide
)
Description:
xen-unstable.hg 12562:c242b6d6a64a backported to 2.6.9-67.0.1.EL
Filename:
MIME Type:
Creator:
Ian Campbell
Created:
2008-01-17 11:03:31 UTC
Size:
8.76 KB
patch
obsolete
># HG changeset patch ># User Ian Campbell <ian.campbell@xensource.com> ># Node ID c242b6d6a64a3697b0ee140aec1d24538543c5d5 ># Parent aaaa249e6f3b7b955605746909eb1a09b8b61061 >[LINUX] Import kasprintf patch from upstream. > >kasprintf has been merged upstream with a slightly different protoype >to the one in Xen. Import this patch and fixup the Xen tree to fit. > >Signed-off-by: Ian Campbell <ian.campbell@xensource.com> >xen-unstable changeset: 12562:c242b6d6a64a3697b0ee140aec1d24538543c5d5 >xen-unstable date: Mon Nov 27 13:50:02 2006 +0000 > >Index: linux-2.6.9-67.0.1.EL/drivers/xen/xenbus/xenbus_client.c >=================================================================== >--- linux-2.6.9-67.0.1.EL.orig/drivers/xen/xenbus/xenbus_client.c 2008-01-16 14:10:14.000000000 +0000 >+++ linux-2.6.9-67.0.1.EL/drivers/xen/xenbus/xenbus_client.c 2008-01-16 14:16:36.000000000 +0000 >@@ -35,9 +35,6 @@ > #include <xen/xenbus.h> > #include <xen/driver_util.h> > >-/* xenbus_probe.c */ >-extern char *kasprintf(const char *fmt, ...); >- > #define DPRINTK(fmt, args...) \ > pr_debug("xenbus_client (%s:%d) " fmt ".\n", __FUNCTION__, __LINE__, ##args) > >@@ -84,7 +81,7 @@ > const char **, unsigned int)) > { > int err; >- char *state = kasprintf("%s/%s", path, path2); >+ char *state = kasprintf(GFP_KERNEL, "%s/%s", path, path2); > if (!state) { > xenbus_dev_fatal(dev, -ENOMEM, "allocating path for watch"); > return -ENOMEM; >@@ -152,7 +149,7 @@ > */ > static char *error_path(struct xenbus_device *dev) > { >- return kasprintf("error/%s", dev->nodename); >+ return kasprintf(GFP_KERNEL, "error/%s", dev->nodename); > } > > >Index: linux-2.6.9-67.0.1.EL/drivers/xen/xenbus/xenbus_probe.c >=================================================================== >--- linux-2.6.9-67.0.1.EL.orig/drivers/xen/xenbus/xenbus_probe.c 2008-01-16 14:10:36.000000000 +0000 >+++ linux-2.6.9-67.0.1.EL/drivers/xen/xenbus/xenbus_probe.c 2008-01-16 14:10:41.000000000 +0000 >@@ -559,27 +559,6 @@ > kfree(to_xenbus_device(dev)); > } > >-/* Simplified asprintf. */ >-char *kasprintf(const char *fmt, ...) >-{ >- va_list ap; >- unsigned int len; >- char *p, dummy[1]; >- >- va_start(ap, fmt); >- /* FIXME: vsnprintf has a bug, NULL should work */ >- len = vsnprintf(dummy, 0, fmt, ap); >- va_end(ap); >- >- p = kmalloc(len + 1, GFP_KERNEL); >- if (!p) >- return NULL; >- va_start(ap, fmt); >- vsprintf(p, fmt, ap); >- va_end(ap); >- return p; >-} >- > static ssize_t xendev_show_nodename(struct device *dev, char *buf) > { > return sprintf(buf, "%s\n", to_xenbus_device(dev)->nodename); >@@ -654,7 +633,7 @@ > char *nodename; > int err; > >- nodename = kasprintf("%s/%s/%s", xenbus_frontend.root, type, name); >+ nodename = kasprintf(GFP_KERNEL, "%s/%s/%s", xenbus_frontend.root, type, name); > if (!nodename) > return -ENOMEM; > >@@ -673,7 +652,7 @@ > char *nodename; > int err; > >- nodename = kasprintf("%s/%s", dir, name); >+ nodename = kasprintf(GFP_KERNEL, "%s/%s", dir, name); > if (!nodename) > return -ENOMEM; > >@@ -694,7 +673,7 @@ > > DPRINTK(""); > >- nodename = kasprintf("%s/%s/%s", xenbus_backend.root, type, domid); >+ nodename = kasprintf(GFP_KERNEL, "%s/%s/%s", xenbus_backend.root, type, domid); > if (!nodename) > return -ENOMEM; > >@@ -800,7 +779,7 @@ > rootlen = strsep_len(node, '/', bus->levels); > if (rootlen < 0) > return; >- root = kasprintf("%.*s", rootlen, node); >+ root = kasprintf(GFP_KERNEL, "%.*s", rootlen, node); > if (!root) > return; > >Index: linux-2.6.9-67.0.1.EL/drivers/xen/xenbus/xenbus_xs.c >=================================================================== >--- linux-2.6.9-67.0.1.EL.orig/drivers/xen/xenbus/xenbus_xs.c 2008-01-16 14:10:36.000000000 +0000 >+++ linux-2.6.9-67.0.1.EL/drivers/xen/xenbus/xenbus_xs.c 2008-01-16 14:16:36.000000000 +0000 >@@ -45,9 +45,6 @@ > #include <xen/xenbus.h> > #include "xenbus_comms.h" > >-/* xenbus_probe.c */ >-extern char *kasprintf(const char *fmt, ...); >- > struct xs_stored_msg { > struct list_head list; > >@@ -289,9 +286,9 @@ > char *buffer; > > if (strlen(name) == 0) >- buffer = kasprintf("%s", dir); >+ buffer = kasprintf(GFP_KERNEL, "%s", dir); > else >- buffer = kasprintf("%s/%s", dir, name); >+ buffer = kasprintf(GFP_KERNEL, "%s/%s", dir, name); > return (!buffer) ? ERR_PTR(-ENOMEM) : buffer; > } > >Index: linux-2.6.9-67.0.1.EL/lib/vsprintf.c >=================================================================== >--- linux-2.6.9-67.0.1.EL.orig/lib/vsprintf.c 2008-01-16 14:10:14.000000000 +0000 >+++ linux-2.6.9-67.0.1.EL/lib/vsprintf.c 2008-01-16 14:18:13.000000000 +0000 >@@ -186,49 +186,49 @@ > size -= precision; > if (!(type&(ZEROPAD+LEFT))) { > while(size-->0) { >- if (buf <= end) >+ if (buf < end) > *buf = ' '; > ++buf; > } > } > if (sign) { >- if (buf <= end) >+ if (buf < end) > *buf = sign; > ++buf; > } > if (type & SPECIAL) { > if (base==8) { >- if (buf <= end) >+ if (buf < end) > *buf = '0'; > ++buf; > } else if (base==16) { >- if (buf <= end) >+ if (buf < end) > *buf = '0'; > ++buf; >- if (buf <= end) >+ if (buf < end) > *buf = digits[33]; > ++buf; > } > } > if (!(type & LEFT)) { > while (size-- > 0) { >- if (buf <= end) >+ if (buf < end) > *buf = c; > ++buf; > } > } > while (i < precision--) { >- if (buf <= end) >+ if (buf < end) > *buf = '0'; > ++buf; > } > while (i-- > 0) { >- if (buf <= end) >+ if (buf < end) > *buf = tmp[i]; > ++buf; > } > while (size-- > 0) { >- if (buf <= end) >+ if (buf < end) > *buf = ' '; > ++buf; > } >@@ -270,7 +270,8 @@ > /* 'z' support added 23/7/1999 S.H. */ > /* 'z' changed to 'Z' --davidm 1/25/99 */ > >- /* Reject out-of-range values early */ >+ /* Reject out-of-range values early. Large positive sizes are >+ used for unknown buffer sizes. */ > if (unlikely((int) size < 0)) { > /* There can be only one.. */ > static int warn = 1; >@@ -280,16 +281,17 @@ > } > > str = buf; >- end = buf + size - 1; >+ end = buf + size; > >- if (end < buf - 1) { >- end = ((void *) -1); >- size = end - buf + 1; >+ /* Make sure end is always >= buf */ >+ if (end < buf) { >+ end = ((void *)-1); >+ size = end - buf; > } > > for (; *fmt ; ++fmt) { > if (*fmt != '%') { >- if (str <= end) >+ if (str < end) > *str = *fmt; > ++str; > continue; >@@ -355,17 +357,17 @@ > case 'c': > if (!(flags & LEFT)) { > while (--field_width > 0) { >- if (str <= end) >+ if (str < end) > *str = ' '; > ++str; > } > } > c = (unsigned char) va_arg(args, int); >- if (str <= end) >+ if (str < end) > *str = c; > ++str; > while (--field_width > 0) { >- if (str <= end) >+ if (str < end) > *str = ' '; > ++str; > } >@@ -380,18 +382,18 @@ > > if (!(flags & LEFT)) { > while (len < field_width--) { >- if (str <= end) >+ if (str < end) > *str = ' '; > ++str; > } > } > for (i = 0; i < len; ++i) { >- if (str <= end) >+ if (str < end) > *str = *s; > ++str; ++s; > } > while (len < field_width--) { >- if (str <= end) >+ if (str < end) > *str = ' '; > ++str; > } >@@ -424,7 +426,7 @@ > continue; > > case '%': >- if (str <= end) >+ if (str < end) > *str = '%'; > ++str; > continue; >@@ -447,11 +449,11 @@ > break; > > default: >- if (str <= end) >+ if (str < end) > *str = '%'; > ++str; > if (*fmt) { >- if (str <= end) >+ if (str < end) > *str = *fmt; > ++str; > } else { >@@ -479,14 +481,13 @@ > str = number(str, end, num, base, > field_width, precision, flags); > } >- if (str <= end) >- *str = '\0'; >- else if (size > 0) >- /* don't write out a null byte if the buf size is zero */ >- *end = '\0'; >- /* the trailing null byte doesn't count towards the total >- * ++str; >- */ >+ if (size > 0) { >+ if (str < end) >+ *str = '\0'; >+ else >+ *end = '\0'; >+ } >+ /* the trailing null byte doesn't count towards the total */ > return str-buf; > } > >@@ -844,3 +845,26 @@ > } > > EXPORT_SYMBOL(sscanf); >+ >+ >+/* Simplified asprintf. */ >+char *kasprintf(unsigned gfp, const char *fmt, ...) >+{ >+ va_list ap; >+ unsigned int len; >+ char *p; >+ >+ va_start(ap, fmt); >+ len = vsnprintf(NULL, 0, fmt, ap); >+ va_end(ap); >+ >+ p = kmalloc(len+1, gfp); >+ if (!p) >+ return NULL; >+ va_start(ap, fmt); >+ vsnprintf(p, len+1, fmt, ap); >+ va_end(ap); >+ return p; >+} >+ >+EXPORT_SYMBOL(kasprintf); >Index: linux-2.6.9-67.0.1.EL/include/linux/kernel.h >=================================================================== >--- linux-2.6.9-67.0.1.EL.orig/include/linux/kernel.h 2008-01-16 14:10:33.000000000 +0000 >+++ linux-2.6.9-67.0.1.EL/include/linux/kernel.h 2008-01-16 14:18:16.000000000 +0000 >@@ -94,6 +94,8 @@ > extern int scnprintf(char * buf, size_t size, const char * fmt, ...) > __attribute__ ((format (printf, 3, 4))); > extern int vscnprintf(char *buf, size_t size, const char *fmt, va_list args); >+extern char *kasprintf(unsigned gfp, const char *fmt, ...) >+ __attribute__ ((format (printf, 2, 3))); > > extern int sscanf(const char *, const char *, ...) > __attribute__ ((format (scanf,2,3)));
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 429103
: 291978 |
291979
|
292483
|
298729
|
298730
|
299451
|
299452
|
306545