svn commit: r212926 - head/sys/cam/scsi

Matthew D Fleming mdf at FreeBSD.org
Mon Sep 20 19:42:15 UTC 2010


Author: mdf
Date: Mon Sep 20 19:42:14 2010
New Revision: 212926
URL: http://svn.freebsd.org/changeset/base/212926

Log:
  Use destroy_dev_sched(9) instead of destroy_dev(9) in passcleanup() as
  it is indirectly a d_close method.
  
  Prompted by:	kib
  Reviewed by:	mav
  MFC after:	2 weeks

Modified:
  head/sys/cam/scsi/scsi_pass.c

Modified: head/sys/cam/scsi/scsi_pass.c
==============================================================================
--- head/sys/cam/scsi/scsi_pass.c	Mon Sep 20 19:36:53 2010	(r212925)
+++ head/sys/cam/scsi/scsi_pass.c	Mon Sep 20 19:42:14 2010	(r212926)
@@ -169,7 +169,11 @@ passcleanup(struct cam_periph *periph)
 		xpt_print(periph->path, "removing device entry\n");
 	devstat_remove_entry(softc->device_stats);
 	cam_periph_unlock(periph);
-	destroy_dev(softc->dev);
+	/*
+	 * passcleanup() is indirectly a d_close method via passclose,
+	 * so using destroy_dev(9) directly can result in deadlock.
+	 */
+	destroy_dev_sched(softc->dev);
 	cam_periph_lock(periph);
 	free(softc, M_DEVBUF);
 }


More information about the svn-src-head mailing list