]> git.baikalelectronics.ru Git - kernel.git/commit
nvme: only setup block integrity if supported by the driver
authorChristoph Hellwig <hch@lst.de>
Sat, 20 May 2017 13:14:45 +0000 (15:14 +0200)
committerChristoph Hellwig <hch@lst.de>
Fri, 26 May 2017 06:54:23 +0000 (09:54 +0300)
commit18ec4b23d2fe202d62ea99e515abe75cdecb32a2
tree0b9009c4b6f35a08c1d3fc93082989901de01739
parentc8c260d948aed8d25e7357a7114e94b960672d2b
nvme: only setup block integrity if supported by the driver

Currently only the PCIe driver supports metadata, so we should not claim
integrity support for the other drivers.  This prevents nasty crashes
with targets that advertise metadata support on fabrics.

Also use the opportunity to factor out some code into a separate helper
that isn't even compiled if CONFIG_BLK_DEV_INTEGRITY is disabled.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <keith.busch@intel.com>
drivers/nvme/host/core.c
drivers/nvme/host/nvme.h
drivers/nvme/host/pci.c