freebsd-dev/sys/cam/scsi
Kenneth D. Merry e4b58dfe33 Fix da(4) locking when probing SMR drives.
Probing host aware and host managed SMR drives got broken in revision
330796.

The added cam_periph_lock() calls were in areas in dadone() where
the peripheral lock was already held.

Since then, dadone() has been split into separate functions that are
dedicated to each probe state.

The result is that when probing a host aware drive, I ran into a recursive
lock acquisition in dadone_probeatalogdir(). I would have run into the
same problem in dadone_probeataiddir(), and in dadone_probeatasup() and
dadone_probeatazone() in the error paths had the probe continued.

The solution is to take out all of the extra cam_periph_lock() calls. I
also added cam_periph_assert(periph, MA_OWNED) near the top of each of
the dadone_* calls. These make it clear to anyone coming along in the
the future that the lock is held in the probe done functions.

Also add a locking assert in daprobedone(), to make it clear that it must
be called with the periph lock held.

Sponsored by:	Spectra Logic
Differential Revision:	https://reviews.freebsd.org/D15764
2018-06-14 17:08:44 +00:00
..
scsi_all.c SPDX: finish tagging sys/cam. 2018-01-16 23:19:57 +00:00
scsi_all.h Use <stdarg.h> instead of <machine/stdarg.h> in userland. 2018-03-20 21:00:45 +00:00
scsi_cd.c cam_periph_runccb() changed several years ago to overwrite the ccb callback 2018-05-01 20:09:29 +00:00
scsi_cd.h sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_ch.c cam_periph_acquire() now returns an errno. 2018-03-19 20:19:00 +00:00
scsi_ch.h sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_da.c Fix da(4) locking when probing SMR drives. 2018-06-14 17:08:44 +00:00
scsi_da.h Improve support for informational exceptions. 2016-12-19 10:25:47 +00:00
scsi_dvcfg.h sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_enc_internal.h sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_enc_safte.c sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_enc_ses.c sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_enc.c Move most of the contents of opt_compat.h to opt_global.h. 2018-04-06 17:35:35 +00:00
scsi_enc.h SPDX: finish tagging sys/cam. 2018-01-16 23:19:57 +00:00
scsi_iu.h
scsi_low.c Remove ccbque.h from i386/isa. 2018-01-09 16:11:33 +00:00
scsi_low.h Remove ccbque.h from i386/isa. 2018-01-09 16:11:33 +00:00
scsi_message.h Add partial support for QUERY TMF to CAM and isp(4). 2015-10-23 18:34:18 +00:00
scsi_pass.c cam_periph_runccb() changed several years ago to overwrite the ccb callback 2018-05-01 20:09:29 +00:00
scsi_pass.h sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_pt.c Return a C errno for cam_periph_acquire(). 2018-02-06 06:42:25 +00:00
scsi_pt.h sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_sa.c cam_periph_runccb() changed several years ago to overwrite the ccb callback 2018-05-01 20:09:29 +00:00
scsi_sa.h sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_ses.h SPDX: finish tagging sys/cam. 2018-01-16 23:19:57 +00:00
scsi_sg.c cam_periph_runccb() changed several years ago to overwrite the ccb callback 2018-05-01 20:09:29 +00:00
scsi_sg.h Overhaul CAM SG driver IOCTL interfaces. 2014-06-02 19:53:53 +00:00
scsi_targ_bh.c sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_target.c Define xpt_path_inq. 2017-12-06 23:05:22 +00:00
scsi_targetio.h sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_xpt.c Return a C errno for cam_periph_acquire(). 2018-02-06 06:42:25 +00:00
smp_all.c sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
smp_all.h sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00