From owner-freebsd-bugs@FreeBSD.ORG Thu Jan 5 09:10:07 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F119216A41F for ; Thu, 5 Jan 2006 09:10:07 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4050D43D53 for ; Thu, 5 Jan 2006 09:10:07 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k059A6QU091441 for ; Thu, 5 Jan 2006 09:10:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k059A6JO091440; Thu, 5 Jan 2006 09:10:06 GMT (envelope-from gnats) Date: Thu, 5 Jan 2006 09:10:06 GMT Message-Id: <200601050910.k059A6JO091440@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Guy Harris Cc: Subject: Re: bin/88463: devfs(8): 'devfs rule add' before 'devfs ruleset' kills devfs. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Guy Harris List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2006 09:10:08 -0000 The following reply was made to PR bin/88463; it has been noted by GNATS. From: Guy Harris To: bug-followup@FreeBSD.org, trasz@pin.if.uz.zgora.pl Cc: Subject: Re: bin/88463: devfs(8): 'devfs rule add' before 'devfs ruleset' kills devfs. Date: Thu, 05 Jan 2006 01:04:32 -0800 This sounds like the bug from http://lists.freebsd.org/pipermail/freebsd-hackers/2006-January/015009.html which I also saw. It appears that if you submit a rule with DEVFSIO_RADD, and the rule set number of the rule is 0, devfs_rules_ioctl() will return without releasing any locks - in particular, it won't release the devfs ruleset lock. This might be the cause. If you're getting devfs rule: ioctl DEVFSIO_RADD: Input/output error from the "devfs rule add", then that's the problem. The fix - release the lock before returning EIO: Index: devfs_rule.c =================================================================== RCS file: /home/ncvs/src/sys/fs/devfs/devfs_rule.c,v retrieving revision 1.20 diff -c -r1.20 devfs_rule.c *** devfs_rule.c 24 Sep 2005 07:03:09 -0000 1.20 --- devfs_rule.c 1 Jan 2006 02:28:32 -0000 *************** *** 186,193 **** error = EEXIST; break; } ! if (rid2rsn(dr->dr_id) == 0) ! return (EIO); error = devfs_rule_insert(dr); break; case DEVFSIO_RAPPLY: --- 186,195 ---- error = EEXIST; break; } ! if (rid2rsn(dr->dr_id) == 0) { ! error = EIO; ! break; ! } error = devfs_rule_insert(dr); break; case DEVFSIO_RAPPLY: