Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
[SCSI] bnx2fc: Avoid calling bnx2fc_if_destroy with unnecessary locks
Browse files Browse the repository at this point in the history
It is not required to hold rtnl_lock and bnx2fc_dev_lock when calling
bnx2fc_if_destroy, as the locking is only required to serialize creation and
deletion of fcoe instances. More importantly, this unnecessary locking causes
deadlock as bnx2fc_if_destroy calls fc_remove_host holding rtnl_lock.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
  • Loading branch information
Bhanu Prakash Gollapudi authored and James Bottomley committed Sep 17, 2011
1 parent 26b2982 commit 0cbf32e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/scsi/bnx2fc/bnx2fc_fcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1487,13 +1487,13 @@ static void bnx2fc_if_destroy(struct fc_lport *lport)
static void __bnx2fc_destroy(struct bnx2fc_interface *interface)
{
struct fc_lport *lport = interface->ctlr.lp;
struct fcoe_port *port = lport_priv(lport);

bnx2fc_interface_cleanup(interface);
bnx2fc_stop(interface);
list_del(&interface->list);
lport = interface->ctlr.lp;
bnx2fc_interface_put(interface);
bnx2fc_if_destroy(lport);
queue_work(bnx2fc_wq, &port->destroy_work);
}

/**
Expand Down Expand Up @@ -1541,11 +1541,7 @@ static void bnx2fc_destroy_work(struct work_struct *work)

BNX2FC_HBA_DBG(lport, "Entered bnx2fc_destroy_work\n");

rtnl_lock();
mutex_lock(&bnx2fc_dev_lock);
bnx2fc_if_destroy(lport);
mutex_unlock(&bnx2fc_dev_lock);
rtnl_unlock();
}

static void bnx2fc_unbind_adapter_devices(struct bnx2fc_hba *hba)
Expand Down

0 comments on commit 0cbf32e

Please sign in to comment.