Skip to content

scsi/bnx2*: Plug hotplug race, correct locking and simplify hotplug code

Thomas Gleixner linux-scsi lkml 1 version Applied

Status from this message: Applied to 4.13/scsi-fixes. Thank you!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 3 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/5scsi/bnx2fc: Plug CPU hotplug racedrivers/scsi/bnx2fc/bnx2fc_hwi.c+23 -220 replies
2/5scsi/bnx2fc: Prevent recursive cpuhotplug lockingdrivers/scsi/bnx2fc/bnx2fc_fcoe.c+8 -70 replies
3/5scsi/bnx2i: Prevent recursive cpuhotplug lockingdrivers/scsi/bnx2i/bnx2i_init.c+8 -71 reply
4/5scsi/bnx2fc: Simplify CPU hotplug codedrivers/scsi/bnx2fc/bnx2fc_fcoe.c include/linux/cpuhotplug.h+15 -550 replies
5/5scsi/bnx2i: Simplify cpu hotplug codedrivers/scsi/bnx2i/bnx2i_init.c include/linux/cpuhotplug.h+15 -510 replies

Reviews trailers per patch

None of the 5 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchChad DupuisSteven Rostedt (VMware)
SeriesA-b
1/5
2/5
3/5T-b
4/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [patch 0/5] scsi/bnx2*: Plug hotplug race, correct locking and simplify hotplug code

The conversion of the cpu hotplug locking to a percpu rwsem does not longer allow recursive locking of the hotplug lock.

The BNX2I and BNX2FC drivers install/remove hotplug states with the hotplug lock held. The install/removal code acquired the hotplug lock as well.

While looking into this, I noticed an interesting hotplug race in the BNX2FC driver, which could result in dereferencing a NULL pointer or freed and potentially reused memory.

The following series addresses these problems and as a final step on top it simplifies the hotplug code in both drivers.

Thanks,

tglx

----

 drivers/scsi/bnx2fc/bnx2fc_fcoe.c |   68 ++++++++------------------------------
 drivers/scsi/bnx2fc/bnx2fc_hwi.c  |   45 ++++++++++++-------------
 drivers/scsi/bnx2i/bnx2i_init.c   |   64 ++++++++---------------------------
 include/linux/cpuhotplug.h        |    2 -
 4 files changed, 53 insertions(+), 126 deletions(-)