OSDN Git Service

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:39:22 +0000 (18:39 +0200)
commit6fa877d2aca8da2f597c3a97355f7b4d8690dc1e
tree3cb3f6a6a85422c0c66dc898e9ec0705e5637e6e
parentd0826ba87dedab9abd3f2628cc9fbee3f413bd4f
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