From owner-freebsd-scsi@FreeBSD.ORG Sun Jul 27 03:17:25 2003 Return-Path: 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 76A1137B401; Sun, 27 Jul 2003 03:17:25 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id EE4F743FAF; Sun, 27 Jul 2003 03:17:23 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id UAA23525; Sun, 27 Jul 2003 20:17:15 +1000 Date: Sun, 27 Jul 2003 20:17:13 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Don Bowman In-Reply-To: Message-ID: <20030727200117.M1537@gamplex.bde.org> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: "'freebsd-scsi@freebsd.org'" cc: "'aic7xxx@freebsd.org'" Subject: RE: AIC7902 w/ seagate U320 drive issue on releng-4 (and current) X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jul 2003 10:17:25 -0000 On Sat, 26 Jul 2003, Don Bowman wrote: > > From: Don Bowman > > ... [scsi errors with seagate cheetah on supermicro with adaptec aic7902] > > I sometimes then get a panic due to this KASSERT in > sys/ufs/ufs/ufs_readwrite.c: > > /* > * We should only get non-zero b_resid when an I/O error > * has occurred, which should cause us to break above. > * However, if the short read did not cause an error, > * then we want to ensure that we do not uiomove bad > * or uninitialized data. > * > * XXX b_resid is only valid when an actual I/O has occured > * and may be incorrect if the buffer is B_CACHE or if the > > * last op on the buffer was a failed write. This KASSERT > * is a precursor to removing it from the UFS code. > */ > KASSERT(bp->b_resid == 0, ("bp->b_resid != 0")); This KASSERT() (and the second paragraph of the comment) somehow was never committed to -current. (rev.1.85 in -current became revs.1.65.2.0 and revs.1.65.2.10 of ufs_readwrite.c in RELENG_4, except the part in rev.1.65.2.10 wasn't actually in 1.85 or any other commit to -current; then history was further tangled by merging ufs_readwrite.c into ../ffs/ffs_vnops.c without merging any history.) I think the KASSERT() is correct, but it doesn't belong in RELENG_4. It would be interesting to know the contents of the buffer header. An inconsistent value of b_resid is less expected here than in most places, since ffs should never write beyond the end of the partition. I would have thought that the case of an i/o error was least problematic -- it should have caused bread() to fail, so that the above is not reached. Bruce