From 1c9b52651dad0ff1fa71fc6205c86d972f25bcc0 Mon Sep 17 00:00:00 2001 From: Matthew Wilcox Date: Tue, 16 Apr 2013 15:21:06 -0400 Subject: NVMe: Fix endian-related problems in user I/O submission path When constructing the command, dsmgmt needs to be treated as a 32-bit value, not a 16-bit value. reftag, apptag and appmask all need to be converted from native-endian to little-endian. Again, sparse's bitwise warnings caught this problem. Thanks to Keith for pointing out the correct way to fix the reftag. Signed-off-by: Matthew Wilcox Acked-by: Keith Busch --- include/linux/nvme.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/linux/nvme.h') diff --git a/include/linux/nvme.h b/include/linux/nvme.h index 09f419d4da4e..7ae7ecfc0947 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h @@ -207,11 +207,11 @@ struct nvme_common_command { __u8 flags; __u16 command_id; __le32 nsid; - __u32 cdw2[2]; + __le32 cdw2[2]; __le64 metadata; __le64 prp1; __le64 prp2; - __u32 cdw10[6]; + __le32 cdw10[6]; }; struct nvme_rw_command { -- cgit v1.2.3