Module Name: src Committed By: mlelstv Date: Mon Nov 21 21:03:22 UTC 2016
Modified Files: src/sys/dev/scsipi: scsipi_base.c Log Message: Lock is already taken when handling async events, don't lock again in scsipi_lookup_periph. Fixes PR kern/51641. To generate a diff of this commit: cvs rdiff -u -r1.167 -r1.168 src/sys/dev/scsipi/scsipi_base.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/scsipi/scsipi_base.c diff -u src/sys/dev/scsipi/scsipi_base.c:1.167 src/sys/dev/scsipi/scsipi_base.c:1.168 --- src/sys/dev/scsipi/scsipi_base.c:1.167 Sun Nov 20 15:37:19 2016 +++ src/sys/dev/scsipi/scsipi_base.c Mon Nov 21 21:03:22 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: scsipi_base.c,v 1.167 2016/11/20 15:37:19 mlelstv Exp $ */ +/* $NetBSD: scsipi_base.c,v 1.168 2016/11/21 21:03:22 mlelstv Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.167 2016/11/20 15:37:19 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.168 2016/11/21 21:03:22 mlelstv Exp $"); #ifdef _KERNEL_OPT #include "opt_scsi.h" @@ -2277,7 +2277,7 @@ scsipi_async_event_max_openings(struct s /* XXX This could really suck with a large LUN space. */ for (; minlun <= maxlun; minlun++) { - periph = scsipi_lookup_periph(chan, mo->mo_target, minlun); + periph = scsipi_lookup_periph_locked(chan, mo->mo_target, minlun); if (periph == NULL) continue; @@ -2373,7 +2373,7 @@ scsipi_async_event_channel_reset(struct if (target == chan->chan_id) continue; for (lun = 0; lun < chan->chan_nluns; lun++) { - periph = scsipi_lookup_periph(chan, target, lun); + periph = scsipi_lookup_periph_locked(chan, target, lun); if (periph) { xs = periph->periph_xscheck; if (xs)