Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Mar 2018 22:07:45 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r331273 - head/sys/cam/scsi
Message-ID:  <201803202207.w2KM7jwt086654@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Tue Mar 20 22:07:45 2018
New Revision: 331273
URL: https://svnweb.freebsd.org/changeset/base/331273

Log:
  Release the "TUR" reference when clearing the TUR work flag. We mostly
  do this right, except when there's no BP and we do a TUR by request.
  In that case, we clear the flag, but don't release the reference,
  leaking the reference on rare occasion.
  
  PR: 226510
  Sponsored by: Netflix

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

Modified: head/sys/cam/scsi/scsi_da.c
==============================================================================
--- head/sys/cam/scsi/scsi_da.c	Tue Mar 20 22:05:21 2018	(r331272)
+++ head/sys/cam/scsi/scsi_da.c	Tue Mar 20 22:07:45 2018	(r331273)
@@ -3114,6 +3114,7 @@ more:
 		if (bp == NULL) {
 			if (cam_iosched_has_work_flags(softc->cam_iosched, DA_WORK_TUR)) {
 				cam_iosched_clr_work_flags(softc->cam_iosched, DA_WORK_TUR);
+				da_periph_release_locked(periph, DA_REF_TUR);
 				scsi_test_unit_ready(&start_ccb->csio,
 				     /*retries*/ da_retry_count,
 				     dadone,
@@ -3137,11 +3138,6 @@ more:
 				biofinish(bp, NULL, 0);
 				goto more;
 			}
-		}
-
-		if (cam_iosched_has_work_flags(softc->cam_iosched, DA_WORK_TUR)) {
-			cam_iosched_clr_work_flags(softc->cam_iosched, DA_WORK_TUR);
-			da_periph_release_locked(periph, DA_REF_TUR);
 		}
 
 		if ((bp->bio_flags & BIO_ORDERED) != 0 ||



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803202207.w2KM7jwt086654>