mrsas: don't reference the removed physical disk of RAID1 during IO submission

When a physical disk(PD) [belonging to a RAID1 Virtual disk(VD)] is
removed, driver may still use the reference to the removed PD while submitting
IO to the controller. Controller firmware faults upon receipt of such IO.
This patch fixes this issue by not using any reference to the removed PD.

Reviewed by:	imp
Approved by:	imp
Sponsored by:	Broadcom Inc
Differential Revision:	https://reviews.freebsd.org/D44282
This commit is contained in:
Sumit Saxena 2024-03-12 06:51:09 +00:00
parent 7a0a6b276c
commit 835b12a5f9

View File

@ -964,7 +964,8 @@ mr_spanset_get_phy_params(struct mrsas_softc *sc, u_int32_t ld, u_int64_t stripR
raid->regTypeReqOnRead != REGION_TYPE_UNUSED)))
pRAID_Context->regLockFlags = REGION_TYPE_EXCLUSIVE;
else if (raid->level == 1) {
pd = MR_ArPdGet(arRef, physArm + 1, map);
physArm++;
pd = MR_ArPdGet(arRef, physArm, map);
if (pd != MR_PD_INVALID) {
*pDevHandle = MR_PdDevHandleGet(pd, map);
*pPdInterface = MR_PdInterfaceTypeGet(pd, map);
@ -1711,7 +1712,8 @@ MR_GetPhyParams(struct mrsas_softc *sc, u_int32_t ld,
pRAID_Context->regLockFlags = REGION_TYPE_EXCLUSIVE;
else if (raid->level == 1) {
/* Get Alternate Pd. */
pd = MR_ArPdGet(arRef, physArm + 1, map);
physArm++;
pd = MR_ArPdGet(arRef, physArm, map);
if (pd != MR_PD_INVALID) {
/* Get dev handle from Pd. */
*pDevHandle = MR_PdDevHandleGet(pd, map);