Date: Wed, 11 Jan 2012 21:58:08 +0200 From: Andriy Gapon <avg@FreeBSD.org> To: freebsd-scsi@FreeBSD.org Subject: Re: dadump: missing cam_periph_unlock for the EIO branch? Message-ID: <4F0DE9D0.40406@FreeBSD.org> In-Reply-To: <4F0D7986.5080309@FreeBSD.org> References: <4F0D7986.5080309@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
on 11/01/2012 13:59 Andriy Gapon said the following: > > It looks like if the dadump() returns EIO, then it fails to unlock the cam > periph lock (the sim lock, really). The leaked lock could lead to unnecessary > secondary panics. What do you think? > > Example: > http://sunner.semmy.ru/~az/avg/12.JPG > http://sunner.semmy.ru/~az/avg/13.JPG So how about something this? diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 29a93ae..985a501 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -1094,6 +1094,7 @@ dadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t leng /*sense_len*/SSD_FULL_SIZE, DA_DEFAULT_TIMEOUT * 1000); xpt_polled_action((union ccb *)&csio); + cam_periph_unlock(periph); if ((csio.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { printf("Aborting dump due to I/O error.\n"); @@ -1105,7 +1106,6 @@ dadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t leng csio.ccb_h.status, csio.scsi_status); return(EIO); } - cam_periph_unlock(periph); return(0); } -- Andriy Gapon
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F0DE9D0.40406>