]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 20 Sep 2021 16:48:48 +0000 (18:48 +0200)
commite203f916c8efe60f69f121b112fb96eeb40d7961
treee494f7d39a53a759031f799bf3539e9be86dd481
parentf980f1c86908402daefc823323d45ed05d01a940
scsi: megaraid_sas: Early detection of VD deletion through RaidMap update

BugLink: https://bugs.launchpad.net/bugs/1939440
[ Upstream commit ae6874ba4b43c5a00065f48599811a09d33b873d ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/scsi/megaraid/megaraid_sas.h
drivers/scsi/megaraid/megaraid_sas_base.c
drivers/scsi/megaraid/megaraid_sas_fp.c