nvmet: fix rw control endian access
authorKeith Busch <kbusch@kernel.org>
Tue, 14 Jan 2025 15:35:08 +0000 (07:35 -0800)
committerKeith Busch <kbusch@kernel.org>
Tue, 14 Jan 2025 15:35:08 +0000 (07:35 -0800)
Fixes: 3ec5c62cfcf060e ("nvmet: handle rw's limited retry flag")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501142128.WexgyMTv-lkp@intel.com/
Cc: Guixin Liu <kanie@linux.alibaba.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/target/io-cmd-bdev.c

index 6380b60fd49005a8a862972f135e55c793fd56ea..2b09b2c69857aa3147afd71133bef14a5b14f355 100644 (file)
@@ -272,7 +272,7 @@ static void nvmet_bdev_execute_rw(struct nvmet_req *req)
                iter_flags = SG_MITER_FROM_SG;
        }
 
-       if (req->cmd->rw.control & NVME_RW_LR)
+       if (req->cmd->rw.control & cpu_to_le16(NVME_RW_LR))
                opf |= REQ_FAILFAST_DEV;
 
        if (is_pci_p2pdma_page(sg_page(req->sg)))