Re: [PATCH] megaraid_sas: fix for a potential deadlock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 23, 2024 at 11:18 PM Tomas Henzl <thenzl@xxxxxxxxxx> wrote:
>
> This fixes a 'possible circular locking dependency detected' warning
>       CPU0                    CPU1
>       ----                    ----
>  lock(&instance->reset_mutex);
>                               lock(&shost->scan_mutex);
>                               lock(&instance->reset_mutex);
>  lock(&shost->scan_mutex);
>
>
> Fix this but temporarily releasing the reset_mutex.
>
> Signed-off-by: Tomas Henzl <thenzl@xxxxxxxxxx>
> ---
>  drivers/scsi/megaraid/megaraid_sas_base.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
> index 6c79c350a4d5..253cc1159661 100644
> --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> @@ -8907,8 +8907,11 @@ megasas_aen_polling(struct work_struct *work)
>                                                    (ld_target_id / MEGASAS_MAX_DEV_PER_CHANNEL),
>                                                    (ld_target_id % MEGASAS_MAX_DEV_PER_CHANNEL),
>                                                    0);
> -                       if (sdev1)
> +                       if (sdev1) {
> +                               mutex_unlock(&instance->reset_mutex);
>                                 megasas_remove_scsi_device(sdev1);
> +                               mutex_lock(&instance->reset_mutex);
> +                       }
>
>                         event_type = SCAN_VD_CHANNEL;
>                         break;
> --
> 2.46.0
>

Patch looks good to me.
Acked-by: Chandrakanth Patil <chandrakanth.patil@xxxxxxxxxxxx>

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux