aboutsummaryrefslogtreecommitdiff
path: root/hw/9pfs/virtio-9p-xattr.c
diff options
context:
space:
mode:
authorVenkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>2011-06-01 12:35:14 +0530
committerVenkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>2011-06-01 10:25:17 -0700
commitfaa44e3d3e986f29579e0d0d07b7aef771184e8c (patch)
treeeed23e2305a7d683f6f10ce6e68ee87a312fc27d /hw/9pfs/virtio-9p-xattr.c
parent873c32139354caef3cc1013f00963cc740a6a727 (diff)
downloadqemu-faa44e3d3e986f29579e0d0d07b7aef771184e8c.zip
qemu-faa44e3d3e986f29579e0d0d07b7aef771184e8c.tar.gz
qemu-faa44e3d3e986f29579e0d0d07b7aef771184e8c.tar.bz2
[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.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/9pfs/virtio-9p-xattr.c b/hw/9pfs/virtio-9p-xattr.c
index f08ce6e..bde0b7f 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;