NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/15262
The following reply was made to PR bin/15262; it has been noted by GNATS.
From: "Darrin B. Jewell" <dbj%mit.edu@localhost>
To: "Jacob Pipkin via gnats" <gnats-admin%NetBSD.org@localhost>
Cc: netbsd-bugs%netbsd.org@localhost, dbj%netbsd.org@localhost, gnats-bugs%netbsd.org@localhost
Subject: Re: bin/15262
Date: Wed, 04 Mar 2026 13:38:39 -0800
It has been a long time since I've been familiar with this code path
so don't block this on me. Thanks for taking look at it.
Darrin
"Jacob Pipkin via gnats" <gnats-admin%NetBSD.org@localhost> writes:
> The following reply was made to PR bin/15262; it has been noted by GNATS.
>
> From: Jacob Pipkin <jacob.pipkin%icloud.com@localhost>
> To: gnats-bugs%netbsd.org@localhost
> Cc:
> Subject: Re: bin/15262
> Date: Mon, 2 Mar 2026 17:18:56 -0600
>
> This should just be a matter of skipping the FLG_UPDATE code path with
> -u and just setting the "update" option directly. Here are my test
> results:
> --
> # grep noatime /etc/fstab
> NAME=70c33570-9733-3a44-b5b8-7351a1b600f0 / ffs
> rw,noatime 1 1
> # mount | grep ' / '
> /dev/dk1 on / type ffs (local)
> # ./mount -u /
> # mount | grep ' / '
> /dev/dk1 on / type ffs (noatime, local)
> # ./mount -o update /
> # mount | grep ' / '
> /dev/dk1 on / type ffs (noatime, local)
> --
>
> Shiny. Here's the patch:
>
> Index: mount.c
> ===================================================================
> RCS file: /cvsroot/src/sbin/mount/mount.c,v
> retrieving revision 1.108
> diff -u -r1.108 mount.c
> --- mount.c 1 Jul 2025 17:55:05 -0000 1.108
> +++ mount.c 2 Mar 2026 23:00:01 -0000
> @@ -150,7 +150,7 @@
> vfstype = optarg;
> break;
> case 'u':
> - init_flags |= FLG_UPDATE;
> + catopt(&options, "update");
> break;
> case 'v':
> verbose++;
> @@ -229,60 +229,35 @@
> */
> canonical_path = realpath(*argv, canonical_path_buf);
>
> - if (init_flags & FLG_UPDATE) {
> - /*
> - * Try looking up the canonical path first,
> - * then try exactly what the user entered.
> - */
> - if ((canonical_path == NULL ||
> - (mntbuf = getmntpt(canonical_path)) == NULL) &&
> - (mntbuf = getmntpt(*argv)) == NULL) {
> -out:
> - errx(EXIT_FAILURE,
> - "Unknown special file or file system `%s'",
> - *argv);
> - }
> - mntfromname = mntbuf->f_mntfromname;
> - if ((fs = getfsfile(mntbuf->f_mntonname)) != NULL) {
> - if (strcmp(fs->fs_spec, "from_mount") != 0)
> - mntfromname = fs->fs_spec;
> - /* ignore the fstab file options. */
> - fs->fs_mntops = NULL;
> - }
> - mntonname = mntbuf->f_mntonname;
> - fstypename = mntbuf->f_fstypename;
> - mountopts = NULL;
> - } else {
> - /*
> - * Try looking up the canonical path first,
> - * then try exactly what the user entered.
> - */
> - if (canonical_path == NULL ||
> - ((fs = getfsfile(canonical_path)) == NULL &&
> - (fs = getfsspec(canonical_path)) == NULL))
> - {
> - if ((fs = getfsfile(*argv)) == NULL &&
> - (fs = getfsspec(*argv)) == NULL) {
> - goto out;
> - }
> + /*
> + * Try looking up the canonical path first,
> + * then try exactly what the user entered.
> + */
> + if (canonical_path == NULL ||
> + ((fs = getfsfile(canonical_path)) == NULL &&
> + (fs = getfsspec(canonical_path)) == NULL))
> + {
> + if ((fs = getfsfile(*argv)) == NULL &&
> + (fs = getfsspec(*argv)) == NULL) {
> + goto out;
> }
> - if (BADTYPE(fs->fs_type))
> - errx(EXIT_FAILURE,
> - "Unknown file system type for `%s'",
> - *argv);
> - if (strcmp(fs->fs_spec, "from_mount") == 0) {
> - if ((canonical_path == NULL ||
> - (mntbuf = getmntpt(canonical_path))
> - == NULL) &&
> - (mntbuf = getmntpt(*argv)) == NULL)
> - goto out;
> - mntfromname = mntbuf->f_mntfromname;
> - } else
> - mntfromname = fs->fs_spec;
> - mntonname = fs->fs_file;
> - fstypename = fs->fs_vfstype;
> - mountopts = fs->fs_mntops;
> }
> + if (BADTYPE(fs->fs_type))
> + errx(EXIT_FAILURE,
> + "Unknown file system type for `%s'",
> + *argv);
> + if (strcmp(fs->fs_spec, "from_mount") == 0) {
> + if ((canonical_path == NULL ||
> + (mntbuf = getmntpt(canonical_path))
> + == NULL) &&
> + (mntbuf = getmntpt(*argv)) == NULL)
> + goto out;
> + mntfromname = mntbuf->f_mntfromname;
> + } else
> + mntfromname = fs->fs_spec;
> + mntonname = fs->fs_file;
> + fstypename = fs->fs_vfstype;
> + mountopts = fs->fs_mntops;
> mntfromname = getfsspecname(buf, sizeof(buf), mntfromname);
> if (mntfromname == NULL)
> err(EXIT_FAILURE, "%s", buf);
>
Home |
Main Index |
Thread Index |
Old Index