libnvdimm, {btt, blk}: do integrity setup before add_disk()
authorVishal Verma <vishal.l.verma@intel.com>
Mon, 5 Mar 2018 23:56:13 +0000 (16:56 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Mar 2018 16:24:41 +0000 (18:24 +0200)
commit865a0221c7e25d3a59ef5cd9fa7c9f2eb5b0a21b
treedebf40b4e6897bad99a9b821b366a37ef18130c5
parent7fbddfb0017600bc5031448755ffa036ee57e31f
libnvdimm, {btt, blk}: do integrity setup before add_disk()

commit 3ffb0ba9b567a8efb9a04ed3d1ec15ff333ada22 upstream.

Prior to 25520d55cdb6 ("block: Inline blk_integrity in struct gendisk")
we needed to temporarily add a zero-capacity disk before registering for
blk-integrity. But adding a zero-capacity disk caused the partition
table scanning to bail early, and this resulted in partitions not coming
up after a probe of the BTT or blk namespaces.

We can now register for integrity before the disk has been added, and
this fixes the rescan problems.

Fixes: 25520d55cdb6 ("block: Inline blk_integrity in struct gendisk")
Reported-by: Dariusz Dokupil <dariusz.dokupil@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvdimm/blk.c
drivers/nvdimm/btt.c