Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Sep 2003 19:36:36 +0200
From:      Thomas Quinot <thomas@FreeBSD.ORG>
To:        freebsd-scsi@freebsd.org, ken@freebsd.org
Subject:   cam_periph recovered sense handling
Message-ID:  <20030919173636.GA867@melusine.cuivre.fr.eu.org>

next in thread | raw e-mail | index | archive | help
When the cam_periph layer automagically recovers sense data by issuing a
REQUEST SENSE command, it must set the CAM_AUTOSNS_VALID bit in the
original CCB's status. Currently, it errouneously sets that bit in the
flags field instead. This causes an endless loop of REQUEST SENSE
actions, eventually leading to memory exhaustion. The following patch
resolves the problem for me; please review.

Thomas.

Index: cam_periph.c
===================================================================
RCS file: /home/ncvs/src/sys/cam/cam_periph.c,v
retrieving revision 1.52
diff -u -r1.52 cam_periph.c
--- cam_periph.c	10 Sep 2003 18:23:43 -0000	1.52
+++ cam_periph.c	19 Sep 2003 17:25:58 -0000
@@ -975,7 +975,7 @@
 				sense_key = saved_ccb->csio.sense_data.flags;
 				sense_key &= SSD_KEY;
 				if (sense_key != SSD_KEY_NO_SENSE) {
-					saved_ccb->ccb_h.flags |=
+					saved_ccb->ccb_h.status |=
 					    CAM_AUTOSNS_VALID;
 					xpt_print_path(saved_ccb->ccb_h.path);
 					printf("Recovered Sense\n");

-- 
    Thomas.Quinot@Cuivre.FR.EU.ORG



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