From owner-freebsd-scsi Sun Dec 1 16:59:18 2002 Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 87D2D37B417 for ; Sun, 1 Dec 2002 16:59:17 -0800 (PST) Received: from rootlabs.com (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 4CA4543ECF for ; Sun, 1 Dec 2002 16:59:16 -0800 (PST) (envelope-from nate@rootlabs.com) Received: (qmail 2285 invoked by uid 1000); 2 Dec 2002 00:59:17 -0000 Date: Sun, 1 Dec 2002 16:59:17 -0800 (PST) From: Nate Lawson To: Yar Tikhiy Cc: freebsd-scsi@freebsd.org Subject: Re: {da,sa,...}open bug? In-Reply-To: <20021129223817.D34288@comp.chem.msu.su> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Fri, 29 Nov 2002, Yar Tikhiy wrote: > On Mon, Nov 25, 2002 at 12:10:14PM -0800, Nate Lawson wrote: > > On Mon, 25 Nov 2002, Yar Tikhiy wrote: > > > > > While preparing the fix, I noticed an additional couple of oddities. > > > First, files under sys/cam/scsi are inconsistent as to the order of > > > calling cam_periph_release() and cam_periph_unlock(): Some of them > > > will call cam_periph_release() first, and the others will call it second. > > > Then, there's a number of places in the code where cam_periph_unlock() > > > won't be called before return on a cam_periph_acquire() error, though > > > the "periph" has been locked. > > > > I think this should be fixed. Please submit a patch for this. > > Here it is. It a) reorders unlock()'s and release()'s where > necessary, b) adds missing unlock()'s, and finally c) changes > "return(error)" to "return(0)" where "error" will be always 0. > The latter is essentially a style fix, but it is important > WRT the discussed necessity to release a peripheral on errors. > Having no "if (error) cam_periph_release(periph)" before such > returns would be confusing. > > To Nate: If the patch looks good to you, please just say OK, and > I'll do the dirty work of obtaining the high approval and committing. patch looks good to me. pls run past ken@ to get a 2nd opinion and re@ for commit approval. mfc after 1 week. -Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message