nvme: fabrics commands should use the fctype field for data direction
authorJon Derrick <jonathan.derrick@intel.com>
Wed, 12 Jul 2017 16:58:19 +0000 (10:58 -0600)
committerChristoph Hellwig <hch@lst.de>
Tue, 25 Jul 2017 15:58:32 +0000 (17:58 +0200)
Fabrics commands with opcode 0x7F use the fctype field to indicate data
direction.

Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
Reviewed-by: Sagi Grimberg <sai@grmberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Fixes: eb793e2c ("nvme.h: add NVMe over Fabrics definitions")

include/linux/nvme.h

index bc74da018bdcd5a3ab3ebf0d5e783a1f9780207b..25d8225dbd046d4dcac62e8261d1e49981b72df9 100644 (file)
@@ -1006,7 +1006,7 @@ static inline bool nvme_is_write(struct nvme_command *cmd)
         * Why can't we simply have a Fabrics In and Fabrics out command?
         */
        if (unlikely(cmd->common.opcode == nvme_fabrics_command))
-               return cmd->fabrics.opcode & 1;
+               return cmd->fabrics.fctype & 1;
        return cmd->common.opcode & 1;
 }