]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-rdma: use nr_phys_segments when map rq to sgl
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Thu, 21 Feb 2019 04:13:34 +0000 (20:13 -0800)
committerChristoph Hellwig <hch@lst.de>
Thu, 21 Feb 2019 13:39:20 +0000 (06:39 -0700)
commitecfb0b23d497a9b2caa013b7005c92e4b3673f97
tree18e2e1a1dc21881e727c4309121e0b1a9bce043d
parent778b5400e48af90ccf74c9ef16bd06d16e45a7ac
nvme-rdma: use nr_phys_segments when map rq to sgl

Use blk_rq_nr_phys_segments() instead of blk_rq_payload_bytes() to check
if a command contains data to be mapped.  This fixes the case where
a struct request contains LBAs, but it has no payload, such as
Write Zeroes support.

Fixes: 15e6d6fe45a5 ("nvme: add support for the Write Zeroes command")
Reported-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Tested-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/rdma.c