Skip to contentSkip to conversation

NVMe: add explicit BLK_DEV_INTEGRITY dependency

PATCH In review Arnd Bergmann 2 participants 2 messages Feb 23, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NVMe: add explicit BLK_DEV_INTEGRITY dependency

A patch that was added to 4.0-rc1 in the last minute caused a build break in the NVMe driver unless integrity support is also enabled:

drivers/block/nvme-core.c: In function 'nvme_dif_remap':
drivers/block/nvme-core.c:523:24: error: dereferencing pointer to incomplete type

  pmap = kmap_atomic(bip->bip_vec->bv_page) + bip->bip_vec->bv_offset;
                        ^
drivers/block/nvme-core.c:523:49: error: dereferencing pointer to incomplete type
  pmap = kmap_atomic(bip->bip_vec->bv_page) + bip->bip_vec->bv_offset;
                                                 ^

This changes the Kconfig entry for NVMe to depend on that support, to avoid the build error. Using 'select' would work as well, but might have unintended side-effects when users do not actually want the integerity support.

Fixes e1e5e5641e6f ("NVMe: Metadata format support")

---
Found on ARM randconfig builds

drivers/block/Kconfig +1 -1
index 1b8094d4d7af..e386dd5b94e9 100644
@@ -312,7 +312,7 @@ config BLK_DEV_NBD
 
 config BLK_DEV_NVME
 	tristate "NVM Express block device"
-	depends on PCI
+	depends on PCI && BLK_DEV_INTEGRITY
 	---help---
 	  The NVM Express driver is for solid state drives directly
 	  connected to the PCI or PCI Express bus.  If you know you
#1 lore raw
Quoted 12 lines · Arnd Bergmann

A patch that was added to 4.0-rc1 in the last minute caused a build break in the NVMe driver unless integrity support is also enabled:

drivers/block/nvme-core.c: In function 'nvme_dif_remap':
drivers/block/nvme-core.c:523:24: error: dereferencing pointer to incomplete type

 pmap = kmap_atomic(bip->bip_vec->bv_page) + bip->bip_vec->bv_offset;
                       ^
drivers/block/nvme-core.c:523:49: error: dereferencing pointer to incomplete type
 pmap = kmap_atomic(bip->bip_vec->bv_page) + bip->bip_vec->bv_offset;
                                                ^
Quoted 4 lines

This changes the Kconfig entry for NVMe to depend on that support, to avoid the build error. Using 'select' would work as well, but might have unintended side-effects when users do not actually want the integerity support.

Thanks for the catch. We do want users to be able to use this with and without blk-integrity, so I'll send a patch using conditional functions between appropriate ifdef's like how scsi and block handle this.