sd: Unregister integrity profile
authorMartin K. Petersen <martin.petersen@oracle.com>
Tue, 14 Apr 2015 20:56:23 +0000 (16:56 -0400)
committerJames Bottomley <JBottomley@Odin.com>
Thu, 16 Apr 2015 17:36:14 +0000 (10:36 -0700)
The new integrity code did not correctly unregister the profile for SD
disks. Call blk_integrity_unregister() when we release a disk.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reported-by: Sagi Grimberg <sagig@dev.mellanox.co.il>
Tested-by: Sagi Grimberg <sagig@mellanox.com>
Cc: stable@vger.kernel.org # v3.17+
Signed-off-by: James Bottomley <JBottomley@Odin.com>
drivers/scsi/sd.c

index dcc42446f58a5e9c21ee72e7fca34d9ff6235c7b..79beebf53302e591bc0661372335561c65d3e006 100644 (file)
@@ -3076,6 +3076,7 @@ static void scsi_disk_release(struct device *dev)
        ida_remove(&sd_index_ida, sdkp->index);
        spin_unlock(&sd_index_lock);
 
+       blk_integrity_unregister(disk);
        disk->private_data = NULL;
        put_disk(disk);
        put_device(&sdkp->device->sdev_gendev);