|
|
4d7edd7 |
From: Li Qiang <liqiang6-s@360.cn>
|
|
|
4d7edd7 |
Date: Tue, 1 Nov 2016 12:00:40 +0100
|
|
|
4d7edd7 |
Subject: [PATCH] 9pfs: convert 'len/copied_len' field in V9fsXattr to the type
|
|
|
4d7edd7 |
of uint64_t
|
|
|
4d7edd7 |
|
|
|
4d7edd7 |
The 'len' in V9fsXattr comes from the 'size' argument in setxattr()
|
|
|
4d7edd7 |
function in guest. The setxattr() function's declaration is this:
|
|
|
4d7edd7 |
|
|
|
4d7edd7 |
int setxattr(const char *path, const char *name,
|
|
|
4d7edd7 |
const void *value, size_t size, int flags);
|
|
|
4d7edd7 |
|
|
|
4d7edd7 |
and 'size' is treated as u64 in linux kernel client code:
|
|
|
4d7edd7 |
|
|
|
4d7edd7 |
int p9_client_xattrcreate(struct p9_fid *fid, const char *name,
|
|
|
4d7edd7 |
u64 attr_size, int flags)
|
|
|
4d7edd7 |
|
|
|
4d7edd7 |
So the 'len' should have an type of 'uint64_t'.
|
|
|
4d7edd7 |
The 'copied_len' in V9fsXattr is used to account for copied bytes, it
|
|
|
4d7edd7 |
should also have an type of 'uint64_t'.
|
|
|
4d7edd7 |
|
|
|
4d7edd7 |
Suggested-by: Greg Kurz <groug@kaod.org>
|
|
|
4d7edd7 |
Signed-off-by: Li Qiang <liqiang6-s@360.cn>
|
|
|
4d7edd7 |
Reviewed-by: Greg Kurz <groug@kaod.org>
|
|
|
4d7edd7 |
Signed-off-by: Greg Kurz <groug@kaod.org>
|
|
|
4d7edd7 |
(cherry picked from commit 8495f9ad26d398f01e208a53f1a5152483a16084)
|
|
|
4d7edd7 |
---
|
|
|
4d7edd7 |
hw/9pfs/9p.h | 4 ++--
|
|
|
4d7edd7 |
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
4d7edd7 |
|
|
|
4d7edd7 |
diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h
|
|
|
4d7edd7 |
index 5750d67..4e3bc52 100644
|
|
|
4d7edd7 |
--- a/hw/9pfs/9p.h
|
|
|
4d7edd7 |
+++ b/hw/9pfs/9p.h
|
|
|
4d7edd7 |
@@ -162,8 +162,8 @@ typedef struct V9fsConf
|
|
|
4d7edd7 |
|
|
|
4d7edd7 |
typedef struct V9fsXattr
|
|
|
4d7edd7 |
{
|
|
|
4d7edd7 |
- int64_t copied_len;
|
|
|
4d7edd7 |
- int64_t len;
|
|
|
4d7edd7 |
+ uint64_t copied_len;
|
|
|
4d7edd7 |
+ uint64_t len;
|
|
|
4d7edd7 |
void *value;
|
|
|
4d7edd7 |
V9fsString name;
|
|
|
4d7edd7 |
int flags;
|