Re: mutex ATAPICAM lock owned at /usr/src/sys/cam/cam_periph.c:316

From: Ganbold <ganbold_at_micom.mng.net>
Date: Sun, 21 Dec 2008 13:17:51 +0800
Ganbold wrote:
> Hi,
>
> I got panic today with recent CURRENT.
>
> All relevant infos are here:
>
> http://people.freebsd.org/~ganbold/ddb.txt
> http://people.freebsd.org/~ganbold/msgbuf.txt
> http://people.freebsd.org/~ganbold/panic.txt
> http://people.freebsd.org/~ganbold/version.txt
>   

Replying myself, I guess there should be unlock before releasing the
periph at scsi_pass.c:

--- /var/current/src/sys/cam/scsi/scsi_pass.c	2008-11-22 16:58:50.000000000 +0800
+++ /usr/src/sys/cam/scsi/scsi_pass.c	2008-12-21 12:59:36.000000000 +0800
_at__at_ -347,8 +347,10 _at__at_
 	if ((softc->flags & PASS_FLAG_OPEN) == 0) {
 		softc->flags |= PASS_FLAG_OPEN;
 	} else {
-		/* Device closes aren't symmertical, so fix up the refcount */
+		/* Device closes aren't symmetrical, so fix up the refcount */
+		cam_periph_unlock(periph);
 		cam_periph_release(periph);
+		return(EINVAL);
 	}
 

 	cam_periph_unlock(periph);

I guess it needs to be committed.
Correct me if I'm wrong here.

thanks,

Ganbold

> thanks,
>
> Ganbold
>
>   


-- 
Bower's Law: Talent goes where the action is.
Received on Sun Dec 21 2008 - 04:17:54 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:39 UTC