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 ||
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to