Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Sep 2003 22:38:51 -0600
From:      "Kenneth D. Merry" <ken@kdm.org>
To:        Thomas Quinot <thomas@FreeBSD.ORG>
Cc:        freebsd-scsi@FreeBSD.ORG
Subject:   Re: cam_periph recovered sense handling
Message-ID:  <20030921043851.GA22790@panzer.kdm.org>
In-Reply-To: <20030919173636.GA867@melusine.cuivre.fr.eu.org>
References:  <20030919173636.GA867@melusine.cuivre.fr.eu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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@kdm.org



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