Date: Sat, 24 Jul 2021 15:05:34 GMT From: Warner Losh <imp@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 6475667f7b72 - main - devctl: don't publish the mount options Message-ID: <202107241505.16OF5Ymo064692@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6475667f7b72f5eb8fcd045967c251e45e38e2a2 commit 6475667f7b72f5eb8fcd045967c251e45e38e2a2 Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2021-07-24 15:03:53 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2021-07-24 15:03:53 +0000 devctl: don't publish the mount options Mount options aren't solely ASCII strings. In addition, experience to date suggests that the mount options are much less useful than was originally supposed and the mount flags suffice to make decisions. Drop the reporting of options for the mount/remount/unmount events. Reviewed by: markj Reported by: KASAN Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31287 --- sys/kern/vfs_mount.c | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 8b4426209818..354113eb3277 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -2553,27 +2553,6 @@ static struct mntoptnames optnames[] = { MNTOPT_NAMES }; -static void -mount_devctl_event_mntopt(struct sbuf *sb, const char *what, struct vfsoptlist *opts) -{ - struct vfsopt *opt; - - if (opts == NULL || TAILQ_EMPTY(opts)) - return; - sbuf_printf(sb, " %s=\"", what); - TAILQ_FOREACH(opt, opts, link) { - if (opt->name[0] == '\0' || (opt->len > 0 && *(char *)opt->value == '\0')) - continue; - devctl_safe_quote_sb(sb, opt->name); - if (opt->len > 0) { - sbuf_putc(sb, '='); - devctl_safe_quote_sb(sb, opt->value); - } - sbuf_putc(sb, ';'); - } - sbuf_putc(sb, '"'); -} - #define DEVCTL_LEN 1024 static void mount_devctl_event(const char *type, struct mount *mp, bool donew) @@ -2606,11 +2585,15 @@ mount_devctl_event(const char *type, struct mount *mp, bool donew) } } sbuf_putc(&sb, '"'); - mount_devctl_event_mntopt(&sb, "opt", mp->mnt_opt); - if (donew) - mount_devctl_event_mntopt(&sb, "optnew", mp->mnt_optnew); sbuf_finish(&sb); + /* + * Options are not published because the form of the options depends on + * the file system and may include binary data. In addition, they don't + * necessarily provide enough useful information to be actionable when + * devd processes them. + */ + if (sbuf_error(&sb) == 0) devctl_notify("VFS", "FS", type, sbuf_data(&sb)); sbuf_delete(&sb);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107241505.16OF5Ymo064692>