[CFR][DEVFS] Add "ruleset" mount option

Martin Matuska mm at FreeBSD.org
Mon Feb 6 19:28:45 UTC 2012


Dňa 6.2.2012 18:40, Jaakko Heinonen wrote / napísal(a):
> On 2012-02-06, Martin Matuska wrote:
>> The attached patch adds a "ruleset" mount option to devfs mounts.
>> +	if (mp->mnt_optnew != NULL &&
>> +	    vfs_getopt(mp->mnt_optnew, "ruleset", NULL, NULL) == 0) {
>> +		if (vfs_scanopt(mp->mnt_optnew, "ruleset", "%d",
>> +		    &rsnum) != 1) {
>> +			vfs_mount_error(mp, "%s",
>> +			    "invalid ruleset specification");
>> +			return (EINVAL);
>> +		}
>> +	}
> The "ruleset" mount option will persist after the devfs_mount() call. It
> will get out of sync if the ruleset is later changed with the devfs
> command.
It is not displayed in mount -v / -p and is not used anywhere on
existing mounts, devfs_mount() doesn't support MNT_UPDATE.
If we would add update support than we still wouldn't rely on this
option as it would be read from devfs.
> devfs_mount() seems to miss a vfs_filteropt(9) call.
There wasn't a vfs_filteropt(9) before, too. I can not tell whether this
is desired, but what I can tell if you introduce a vfs_filteropt you
change the behavior of mounting devfs.
Maybe it is desired, but this is something open for discussion, I do not
feel privileged to decide alone what options are to be allowed
(readonly, noatime, nosymfollow, etc.). As a minimum, you need the
"from" option allowed. This may very well break backwards compatibility.



-- 
Martin Matuska
FreeBSD committer
http://blog.vx.sk



More information about the freebsd-fs mailing list