Page MenuHomeFreeBSD

D15435.1794802455.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D15435.1794802455.diff

Index: FreeBSD/sys/cam/scsi/scsi_da.c
===================================================================
--- FreeBSD/sys/cam/scsi/scsi_da.c
+++ FreeBSD/sys/cam/scsi/scsi_da.c
@@ -309,7 +309,7 @@
struct cam_iosched_softc *cam_iosched;
struct bio_queue_head delete_run_queue;
LIST_HEAD(, ccb_hdr) pending_ccbs;
- int refcount; /* Active xpt_action() calls */
+ int refcount; /* Active CCBs */
da_state state;
da_flags flags;
da_quirks quirks;
@@ -3243,7 +3243,6 @@
cam_periph_unlock(periph);
xpt_action(start_ccb);
cam_periph_lock(periph);
- softc->refcount--;
/* May have more work to do, so ensure we stay scheduled */
daschedule(periph);
@@ -4402,6 +4401,13 @@
*/
cam_iosched_bio_complete(softc->cam_iosched, bp, done_ccb);
xpt_release_ccb(done_ccb);
+
+ /*
+ * Release the periph refcount taken in dastart() for each CCB.
+ */
+ KASSERT(softc->refcount >= 1, ("dadone softc %p refcount %d", softc, softc->refcount));
+ softc->refcount--;
+
if (state == DA_CCB_DELETE) {
TAILQ_HEAD(, bio) queue;

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 16, 4:14 AM (3 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41759501
Default Alt Text
D15435.1794802455.diff (1 KB)

Event Timeline