]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
fix data_size and metadata_size types
authorHeitor Ricardo Alves de Siqueira <halves@linux.vnet.ibm.com>
Fri, 22 Apr 2016 19:21:33 +0000 (16:21 -0300)
committerHeitor Ricardo Alves de Siqueira <halves@linux.vnet.ibm.com>
Fri, 22 Apr 2016 19:57:52 +0000 (16:57 -0300)
The data_size and metadata_size fields in the config struct are declared as
__u32, but should actually be __u64. The current types cause issues in the
argument parsing functions depending on machine architecture and endianness. In
ppc64, using __u32 causes "data size not provided" errors due to the way writes
are being done by argconfig_parse() at src/argconfig.c. Changing the types to
__u64 should fix this behaviour and is in accordance to the CFG_LONG_SUFFIX
flag.

Signed-off-by: Heitor Ricardo Alves de Siqueira <halves@linux.vnet.ibm.com>
nvme.c

diff --git a/nvme.c b/nvme.c
index cdfc9744a56f8ae0e5475cad1c0f17fde2bbfb33..17c6505551ad6b1325c01993e4fd3358071d7b11 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -2042,8 +2042,8 @@ static int submit_io(int opcode, char *command, const char *desc,
        struct config {
                __u64 start_block;
                __u16 block_count;
-               __u32 data_size;
-               __u32 metadata_size;
+               __u64 data_size;
+               __u64 metadata_size;
                __u32 ref_tag;
                char  *data;
                char  *metadata;