Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Jan 2006 09:10:06 GMT
From:      Guy Harris <guy@alum.mit.edu>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/88463: devfs(8): 'devfs rule add'  before 'devfs ruleset' kills devfs.
Message-ID:  <200601050910.k059A6JO091440@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/88463; it has been noted by GNATS.

From: Guy Harris <guy@alum.mit.edu>
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:
 
 
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200601050910.k059A6JO091440>