Bug 194256 - [cam] xptpdrvtraverse spins and deadlocks CAM
Summary: [cam] xptpdrvtraverse spins and deadlocks CAM
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-08 21:27 UTC by Scott M. Ferris
Modified: 2014-10-12 06:15 UTC (History)
2 users (show)

See Also:


Attachments
cam_xpt.diff (930 bytes, patch)
2014-10-08 21:27 UTC, Scott M. Ferris
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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