Date: Mon, 06 Feb 2012 14:13:26 +0100 From: Martin Matuska <mm@FreeBSD.org> To: Konstantin Belousov <kostikbel@gmail.com> Cc: freebsd-fs@freebsd.org Subject: Re: [CFR][DEVFS] Add "ruleset" mount option Message-ID: <4F2FD1F6.7020903@FreeBSD.org> In-Reply-To: <20120206130414.GS3283@deviant.kiev.zoral.com.ua> References: <4F2F9CB9.3040000@FreeBSD.org> <20120206123613.GR3283@deviant.kiev.zoral.com.ua> <4F2FCEE6.1080400@FreeBSD.org> <20120206130414.GS3283@deviant.kiev.zoral.com.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
On 6. 2. 2012 14:04, Konstantin Belousov wrote: > On Mon, Feb 06, 2012 at 02:00:22PM +0100, Martin Matuska wrote: >> On 6. 2. 2012 13:36, Konstantin Belousov wrote: >>> On Mon, Feb 06, 2012 at 10:26:17AM +0100, Martin Matuska wrote: >>>> The devfs(8) command supports configuring specific rulesets for devfs(5) >>>> mounts. >>>> However, it operates on already mounted devfs filesystems only and it is >>>> impossible to configure a specific ruleset on mount-time. >>>> >>>> The attached patch adds a "ruleset" mount option to devfs mounts. >>>> The ruleset is automatically applied upon mount time. If the ruleset >>>> doesn't exist, an empty ruleset with the given numer is created and >>>> can be modified with devfs(8) later. >>>> >>>> The patch is also available at: >>>> http://people.freebsd.org/~mm/patches/devfs/devfs_mount_ruleset.patch >>>> >>>> Please review and/or comment my attached patch. >>>> >>> Did you tested this with witness turned on ? It seems not. >> Yes, I did, no warnings or error messages on my console. > Are you sure ? Did you tried to change rulesets after mounting > some devfs with ruleset option ? > > From what I see, sx_rules is after dm_lock, e.g. in devfs_rules_ioctl(), > while your patch insists on reversed order. In my patch sx_rules is after dm_lock, too: devfs_vfsops.c: if (rsnum != 0) { sx_xlock(&fmp->dm_lock); devfs_ruleset_set(rsnum, fmp); sx_xunlock(&fmp->dm_lock); } devfs_rule.c: void devfs_ruleset_set(devfs_rsnum rsnum, struct devfs_mount *dm) { sx_assert(&dm->dm_lock, SX_XLOCKED); sx_xlock(&sx_rules); devfs_ruleset_use(rsnum, dm); sx_xunlock(&sx_rules); } -- Martin Matuska FreeBSD committer http://blog.vx.sk
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F2FD1F6.7020903>