[CFR][DEVFS] Add "ruleset" mount option
Martin Matuska
mm at FreeBSD.org
Mon Feb 6 13:13:39 UTC 2012
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
More information about the freebsd-fs
mailing list