Skip to content

Commit 6d3a56e

Browse files
sreekanthbrcmmartinkpetersen
authored andcommitted
scsi: mpt3sas: Fix for block device of raid exists even after deleting raid disk
While merging mpt3sas & mpt2sas code, we added the is_warpdrive check condition on the wrong line --------------------------------------------------------------------------- scsih_target_alloc(struct scsi_target *starget) sas_target_priv_data->handle = raid_device->handle; sas_target_priv_data->sas_address = raid_device->wwid; sas_target_priv_data->flags |= MPT_TARGET_FLAGS_VOLUME; - raid_device->starget = starget; + sas_target_priv_data->raid_device = raid_device; + if (ioc->is_warpdrive) + raid_device->starget = starget; } spin_unlock_irqrestore(&ioc->raid_device_lock, flags); return 0; ------------------------------------------------------------------------------ That check should be for the line sas_target_priv_data->raid_device = raid_device; Due to above hunk, we are not initializing raid_device's starget for raid volumes, and so during raid disk deletion driver is not calling scsi_remove_target() API as driver observes starget field of raid_device's structure as NULL. Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@broadcom.com> Cc: <stable@vger.kernel.org> # v4.4+ Fixes: 7786ab6 ("mpt3sas: Ported WarpDrive product SSS6200 support") Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 1fdd142 commit 6d3a56e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/scsi/mpt3sas/mpt3sas_scsih.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,9 +1273,9 @@ scsih_target_alloc(struct scsi_target *starget)
12731273
sas_target_priv_data->handle = raid_device->handle;
12741274
sas_target_priv_data->sas_address = raid_device->wwid;
12751275
sas_target_priv_data->flags |= MPT_TARGET_FLAGS_VOLUME;
1276-
sas_target_priv_data->raid_device = raid_device;
12771276
if (ioc->is_warpdrive)
1278-
raid_device->starget = starget;
1277+
sas_target_priv_data->raid_device = raid_device;
1278+
raid_device->starget = starget;
12791279
}
12801280
spin_unlock_irqrestore(&ioc->raid_device_lock, flags);
12811281
return 0;

0 commit comments

Comments
 (0)