cam_periph recovered sense handling

Kenneth D. Merry ken at kdm.org
Sat Sep 20 21:39:07 PDT 2003


On Fri, Sep 19, 2003 at 19:36:36 +0200, Thomas Quinot wrote:
> 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");
> 
> -- 

Looks like the correct fix, good catch.

Feel free to commit it.

Ken
-- 
Kenneth Merry
ken at kdm.org


More information about the freebsd-scsi mailing list