scsi: megaraid_sas: Early detection of VD deletion through RaidMap update
authorKashyap Desai <kashyap.desai@broadcom.com>
Fri, 28 May 2021 13:13:05 +0000 (18:43 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 2 Jun 2021 05:06:33 +0000 (01:06 -0400)
commitae6874ba4b43c5a00065f48599811a09d33b873d
treea607a36de0e47b8491ab6827349a119fdbfbbb6f
parentb5438f48fdd8e1c3f130d32637511efd32038152
scsi: megaraid_sas: Early detection of VD deletion through RaidMap update

Consider the case where a VD is deleted and the targetID of that VD is
assigned to a newly created VD. If the sequence of deletion/addition of VD
happens very quickly there is a possibility that second event (VD add)
occurs even before the driver processes the first event (VD delete).  As
event processing is done in deferred context the device list remains the
same (but targetID is re-used) so driver will not learn the VD
deletion/additon. I/Os meant for the older VD will be directed to new VD
which may lead to data corruption.

Make driver detect the deleted VD as soon as possible based on the RaidMap
update and block further I/O to that device.

Link: https://lore.kernel.org/r/20210528131307.25683-4-chandrakanth.patil@broadcom.com
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/megaraid/megaraid_sas.h
drivers/scsi/megaraid/megaraid_sas_base.c
drivers/scsi/megaraid/megaraid_sas_fp.c