From owner-freebsd-stable@FreeBSD.ORG Sat Apr 9 15:20:58 2005 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4583116A4CF for ; Sat, 9 Apr 2005 15:20:58 +0000 (GMT) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3764D43D45 for ; Sat, 9 Apr 2005 15:20:53 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from [192.168.254.11] (junior-wifi.samsco.home [192.168.254.11]) (authenticated bits=0) by pooker.samsco.org (8.13.1/8.13.1) with ESMTP id j39FMkq4063698; Sat, 9 Apr 2005 09:22:50 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <4257F20C.70004@samsco.org> Date: Sat, 09 Apr 2005 09:17:32 -0600 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.5) Gecko/20050218 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Anthony Downer , dsze@alumni.uwaterloo.ca Content-Type: multipart/mixed; boundary="------------070707060207040002010207" X-Spam-Status: No, score=-2.8 required=3.8 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on pooker.samsco.org cc: stable@freebsd.org cc: mb@imp.ch Subject: [PATCH] Stability fixes for IPS driver for 4.x X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Apr 2005 15:20:58 -0000 This is a multi-part message in MIME format. --------------070707060207040002010207 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit All, Thanks to the keen eye of David Sze, the cause of the instability in the ips driver in FreeBSD 4.x might have been found. If it's affecting you, please try the attached patch and let me know the results. I'll commit it when everyone is happy with it. Thanks, Scott --------------070707060207040002010207 Content-Type: text/plain; name="ips-4.x-crash.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ips-4.x-crash.diff" Index: ips_commands.c =================================================================== RCS file: /usr/ncvs/src/sys/dev/ips/ips_commands.c,v retrieving revision 1.11.6.1 diff -u -r1.11.6.1 ips_commands.c --- ips_commands.c 13 Jan 2005 00:46:40 -0000 1.11.6.1 +++ ips_commands.c 9 Apr 2005 15:09:50 -0000 @@ -162,8 +162,11 @@ void ips_start_io_request(ips_softc_t *sc) { struct buf *iobuf; + int s + s = splbio(); iobuf = bufq_first(&sc->queue); + splx(s); if(!iobuf) { return; } @@ -171,8 +174,10 @@ if(ips_get_free_cmd(sc, ips_send_io_request, iobuf, IPS_NOWAIT_FLAG)){ return; } - + + s = splbio(); bufq_remove(&sc->queue, iobuf); + splx(s); return; } Index: ips_disk.c =================================================================== RCS file: /usr/ncvs/src/sys/dev/ips/ips_disk.c,v retrieving revision 1.6.6.1 diff -u -r1.6.6.1 ips_disk.c --- ips_disk.c 13 Jan 2005 00:46:40 -0000 1.6.6.1 +++ ips_disk.c 9 Apr 2005 15:07:50 -0000 @@ -128,12 +128,15 @@ static void ipsd_strategy(struct buf *iobuf) { ipsdisk_softc_t *dsc; + int s; dsc = iobuf->b_dev->si_drv1; DEVICE_PRINTF(8,dsc->dev,"in strategy\n"); devstat_start_transaction(&dsc->stats); iobuf->b_driver1 = (void *)(uintptr_t)dsc->sc->drives[dsc->disk_number].drivenum; - bufqdisksort(&dsc->sc->queue, iobuf); + s = splbio(); + bufq_insert_tail(&dsc->sc->queue, iobuf); + splx(s); ips_start_io_request(dsc->sc); } --------------070707060207040002010207--