Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Aug 2007 08:53:45 -0500
From:      "Scot Hetzel" <swhetzel@gmail.com>
To:        karol.kwiat@gmail.com
Cc:        freebsd-current@freebsd.org
Subject:   Re: Can't remove 'noatime' on mounted filesystem on CURRENT
Message-ID:  <790a9fff0708090653ld9ee781vead81f533ff5e38c@mail.gmail.com>
In-Reply-To: <46BAF87E.8020406@gmail.com>
References:  <46BAF87E.8020406@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 8/9/07, Karol Kwiatkowski <karol.kwiat@gmail.com> wrote:
> It seems to be impossible to remove 'noatime' property on mounted
> filesystem (via -u option):
>
> # mount | grep ad0s3e
> /dev/ad0s3e on /data (ufs, local, noexec, nosuid, soft-updates)
> # mount -u -o noatime /data
> # mount | grep ad0s3e
> /dev/ad0s3e on /data (ufs, local, noatime, soft-updates)
> # mount -u -o atime /data
> # mount | grep ad0s3e
> /dev/ad0s3e on /data (ufs, local, noatime, soft-updates)
>
> This works on 6.2-RELEASE.
>
> Btw, setting 'noatime' removes 'noexec' and 'nosuid' in above example.
> Is this expected behaviour? Can't decide after reading mount(8).
>

hp010# mount -u -o noexec,nosuid /tmp ; mount | grep tmp
/dev/ad1s2e on /tmp (ufs, local, noexec, nosuid)
hp010# mount -u -o noatime /tmp ; mount | grep tmp
/dev/ad1s2e on /tmp (ufs, local, noatime)
hp010# mount -u -o noexec,nosuid /tmp ; mount | grep tmp
/dev/ad1s2e on /tmp (ufs, local, noatime, noexec, nosuid)
hp010# mount -u -o noatime /tmp ; mount | grep tmp
/dev/ad1s2e on /tmp (ufs, local, noatime)
hp010# mount -u -o atime /tmp ; mount | grep tmp
/dev/ad1s2e on /tmp (ufs, local, noatime)

The only way to get rid of noatime is to umount and remount the UFS filesystem.

ZFS seems to have a similar problem with resetting the atime, exec,
and setuid mount options when used with mount.

hp010# umount /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default

hp010# zfs mount -a
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local)

hp010# mount -u -o noexec,nosuid /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      off                           temporary
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local,
noexec, nosuid)

Why doesn't the setuid property change to 'temporary' for
rootpool/usr/ports/distfiles?

hp010# mount -u -o exec,suid /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      off                           temporary
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local,
noexec, nosuid)

mount can't get rid of these options.

hp010# mount -u -o noatime /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     off                           temporary
rootpool/usr/ports/distfiles  exec      off                           temporary
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local,
noatime, noexec, nosuid)

hp010# mount -u -o atime /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     off                           temporary
rootpool/usr/ports/distfiles  exec      off                           temporary
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local,
noatime, noexec, nosuid)

Same problem with getting rid of noatime.  I would have expected mount
to be able to be able to change the zfs properties of atime, exec back
to on.

hp010# zfs inherit -r atime rootpool/usr/ports/distfiles
hp010# zfs inherit -r exec rootpool/usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, nosuid)


hp010# zfs set setuid=off rootpool/usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    off                           local
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, nosuid)

hp010# zfs inherit -r setuid rootpool/usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local)

We have now set everything back to the default mount options using 'zfs inherit'

hp010# mount -u -o noatime,noexec,nosuid /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, nosuid)

Now mount can't set noatime or noexec.

hp010# zfs inherit -r setuid rootpool/usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local)

Back to the defaults again.

This last part gets a bit strange, without umounting
/usr/ports/distfiles, I tried the following:

hp010# mount -u -o nosuid /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, nosuid)
hp010# zfs set setuid=off rootpool/usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    off                           local
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, nosuid)
hp010# zfs inherit -r setuid rootpool/usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local)
hp010# mount -u -o noatime,noexec,nosuid /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      off                           temporary
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local,
noexec, nosuid)
hp010# zfs inherit -r setuid rootpool/usr/ports/distfiles
hp010# zfs inherit -r exec rootpool/usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local)
hp010# mount -u -o noatime,noexec,nosuid /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      off                           temporary
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local,
noexec, nosuid)

It won't set noatime when noexec and nosuid are specified.

hp010# mount -u -o noatime /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, nosuid)

Now it removed noexec, and didn't set noatime.

hp010# zfs inherit -r setuid rootpool/usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local)

Scot
-- 
DISCLAIMER:
No electrons were mamed while sending this message. Only slightly bruised.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?790a9fff0708090653ld9ee781vead81f533ff5e38c>