Bug 194256

Summary: [cam] xptpdrvtraverse spins and deadlocks CAM
Product: Base System Reporter: Scott M. Ferris <smferris>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Many People CC: benno, mav
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
cam_xpt.diff none

Description Scott M. Ferris 2014-10-08 21:27:59 UTC
Created attachment 148117 [details]
cam_xpt.diff

Change periph to next_periph inside of a couple of loops, so that the loops
skip over periphs that have CAM_PERIPH_FREE set, rather than spin forever and
deadlock CAM by never releasing a mutex.  Looks like a copy&paste bug from some
other loops that iterated over periph rather than next_periph.

Sponsored-by: EMC/Isilon Storage Division
Comment 1 commit-hook freebsd_committer freebsd_triage 2014-10-09 05:54:37 UTC
A commit references this bug:

Author: mav
Date: Thu Oct  9 05:53:59 UTC 2014
New revision: 272805
URL: https://svnweb.freebsd.org/changeset/base/272805

Log:
  Use proper variable when looping through periphs with CAM_PERIPH_FREE.

  PR:		194256
  Submitted by:	Scott M. Ferris <smferris@gmail.com>
  MFC after:	3 days
  Sponsored by:	EMC/Isilon Storage Division

Changes:
  head/sys/cam/cam_xpt.c
Comment 2 Alexander Motin freebsd_committer freebsd_triage 2014-10-09 05:54:46 UTC
Good catch. Committed.
Comment 3 commit-hook freebsd_committer freebsd_triage 2014-10-12 06:15:40 UTC
A commit references this bug:

Author: mav
Date: Sun Oct 12 06:14:51 UTC 2014
New revision: 272977
URL: https://svnweb.freebsd.org/changeset/base/272977

Log:
  Use proper variable when looping through periphs with CAM_PERIPH_FREE.

  PR:		194256
  Submitted by:	Scott M. Ferris <smferris@gmail.com>
  Sponsored by:	EMC/Isilon Storage Division

Changes:
_U  stable/10/
  stable/10/sys/cam/cam_xpt.c