[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PULL 12/14] hw/9pfs: Fix errno value for xattr functions
From: |
Michael Tokarev |
Subject: |
[Qemu-trivial] [PULL 12/14] hw/9pfs: Fix errno value for xattr functions |
Date: |
Sun, 6 Oct 2013 13:32:57 +0400 |
From: "Daniel P. Berrange" <address@hidden>
If there is no operation driver for the xattr type the
functions return '-1' and set errno to '-EOPNOTSUPP'.
When the calling code sets 'ret = -errno' this turns
into a large positive number.
In Linux 3.11, the kernel has switched to using 9p
version 9p2000.L, instead of 9p2000.u, which enables
support for xattr operations. This on its own is harmless,
but for another change which makes it request the xattr
with a name 'security.capability'.
The result is that the guest sees a succesful return
of 95 bytes of data, instead of a failure with errno
set to 95. Since the kernel expects a maximum of 20
bytes for an xattr return this gets translated to the
unexpected errno ERANGE.
This all means that when running a binary off a 9p fs
in 3.11 kernels you get a fun result of:
# ./date
sh: ./date: Numerical result out of range
The only workaround is to pass 'version=9p2000.u' when
mounting the 9p fs in the guest, to disable all use of
xattrs.
Signed-off-by: Daniel P. Berrange <address@hidden>
Reviewed-by: Aneesh Kumar K.V <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
hw/9pfs/virtio-9p-xattr.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/9pfs/virtio-9p-xattr.c b/hw/9pfs/virtio-9p-xattr.c
index 90ae565..3fae557 100644
--- a/hw/9pfs/virtio-9p-xattr.c
+++ b/hw/9pfs/virtio-9p-xattr.c
@@ -36,7 +36,7 @@ ssize_t v9fs_get_xattr(FsContext *ctx, const char *path,
if (xops) {
return xops->getxattr(ctx, path, name, value, size);
}
- errno = -EOPNOTSUPP;
+ errno = EOPNOTSUPP;
return -1;
}
@@ -123,7 +123,7 @@ int v9fs_set_xattr(FsContext *ctx, const char *path, const
char *name,
if (xops) {
return xops->setxattr(ctx, path, name, value, size, flags);
}
- errno = -EOPNOTSUPP;
+ errno = EOPNOTSUPP;
return -1;
}
@@ -135,7 +135,7 @@ int v9fs_remove_xattr(FsContext *ctx,
if (xops) {
return xops->removexattr(ctx, path, name);
}
- errno = -EOPNOTSUPP;
+ errno = EOPNOTSUPP;
return -1;
}
--
1.7.10.4
- [Qemu-trivial] [PULL 00/14] Trivial patches for 2013-10-06, Michael Tokarev, 2013/10/06
- [Qemu-trivial] [PULL 02/14] tests: Update .gitignore for test-int128 and test-bitops, Michael Tokarev, 2013/10/06
- [Qemu-trivial] [PULL 08/14] sh4: Fix serial line access for Linux kernels later than 3.2, Michael Tokarev, 2013/10/06
- [Qemu-trivial] [PULL 06/14] target-i386: Fix compiler warning (integer constant is too large), Michael Tokarev, 2013/10/06
- [Qemu-trivial] [PULL 14/14] migration: Fix compiler warning ('caps' may be used uninitialized), Michael Tokarev, 2013/10/06
- [Qemu-trivial] [PULL 12/14] hw/9pfs: Fix errno value for xattr functions,
Michael Tokarev <=
- [Qemu-trivial] [PULL 11/14] vl: Clean up unnecessary boot_order complications, Michael Tokarev, 2013/10/06
- [Qemu-trivial] [PULL 03/14] tests: Fix schema parser test for in-tree build, Michael Tokarev, 2013/10/06
- [Qemu-trivial] [PULL 05/14] block: Remove unused assignment (fixes warning from clang), Michael Tokarev, 2013/10/06
- [Qemu-trivial] [PULL 01/14] .gitignore: ignore tests/qemu-iotests/socket_scm_helper, Michael Tokarev, 2013/10/06
- [Qemu-trivial] [PULL 07/14] hw/alpha: Fix compiler warning (integer constant is too large), Michael Tokarev, 2013/10/06
- [Qemu-trivial] [PULL 09/14] pci-ohci: Add missing 'break' in ohci_service_td, Michael Tokarev, 2013/10/06
- [Qemu-trivial] [PULL 04/14] exec: cleanup DEBUG_SUBPAGE, Michael Tokarev, 2013/10/06
- [Qemu-trivial] [PULL 13/14] util/path: Fix type which is longer than 8 bit for MinGW, Michael Tokarev, 2013/10/06
- [Qemu-trivial] [PULL 10/14] qemu-char: Fix potential out of bounds access to local arrays, Michael Tokarev, 2013/10/06