diff options
author | Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com> | 2011-06-01 12:35:14 +0530 |
---|---|---|
committer | Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com> | 2011-06-01 10:25:17 -0700 |
commit | faa44e3d3e986f29579e0d0d07b7aef771184e8c (patch) | |
tree | eed23e2305a7d683f6f10ce6e68ee87a312fc27d /hw/9pfs/virtio-9p-xattr.c | |
parent | 873c32139354caef3cc1013f00963cc740a6a727 (diff) |
[virtio-9p] Make rpath thread safe
Current rpath inline function is heavily used in all system calls.
This function has a static buffer making it a non-thread safe function.
This patch introduces new thread-safe routine and makes use of it.
Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Diffstat (limited to 'hw/9pfs/virtio-9p-xattr.c')
-rw-r--r-- | hw/9pfs/virtio-9p-xattr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/9pfs/virtio-9p-xattr.c b/hw/9pfs/virtio-9p-xattr.c index f08ce6ec5f..bde0b7fb4f 100644 --- a/hw/9pfs/virtio-9p-xattr.c +++ b/hw/9pfs/virtio-9p-xattr.c @@ -66,20 +66,21 @@ ssize_t v9fs_list_xattr(FsContext *ctx, const char *path, void *value, size_t vsize) { ssize_t size = 0; + char buffer[PATH_MAX]; void *ovalue = value; XattrOperations *xops; char *orig_value, *orig_value_start; ssize_t xattr_len, parsed_len = 0, attr_len; /* Get the actual len */ - xattr_len = llistxattr(rpath(ctx, path), value, 0); + xattr_len = llistxattr(rpath(ctx, path, buffer), value, 0); if (xattr_len <= 0) { return xattr_len; } /* Now fetch the xattr and find the actual size */ orig_value = qemu_malloc(xattr_len); - xattr_len = llistxattr(rpath(ctx, path), orig_value, xattr_len); + xattr_len = llistxattr(rpath(ctx, path, buffer), orig_value, xattr_len); /* store the orig pointer */ orig_value_start = orig_value; |