Date: Thu, 9 Aug 2007 19:44:10 +0200 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: Scot Hetzel <swhetzel@gmail.com> Cc: FreeBSD-CURRENT@freebsd.org Subject: Re: mount gets into a state where it won't set/unset ZFS properties (atime, exec, setuid) Message-ID: <20070809174410.GA9454@garage.freebsd.pl> In-Reply-To: <790a9fff0708091007h48cb5133t16638a24076795f8@mail.gmail.com> References: <790a9fff0708091007h48cb5133t16638a24076795f8@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--AhhlLboLdkugWU4S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 09, 2007 at 12:07:08PM -0500, Scot Hetzel wrote: > While checking out a problem with mount unsetting noatime on a UFS > system, I tested mount with both a UFS and ZFS filesystems. The ZFS > filesystem had several problems: >=20 > hp010# uname -a > FreeBSD hp010.hetzel.org 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Wed Aug > 8 10:38:34 CDT 2007 > root@hp010.hetzel.org:/usr/src/7x/sys/amd64/compile/GENERIC.debug > amd64 >=20 > hp010# umount /usr/ports/distfiles > hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount > | grep distfiles > NAME PROPERTY VALUE SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec on def= ault > rootpool/usr/ports/distfiles setuid on def= ault >=20 > hp010# zfs mount -a > hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount > | grep distfiles > NAME PROPERTY VALUE SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec on def= ault > rootpool/usr/ports/distfiles setuid on def= ault > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local) >=20 > 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 SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec off tem= porary > rootpool/usr/ports/distfiles setuid on def= ault > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, > noexec, nosuid) >=20 > Why doesn't the setuid property change to 'temporary' for > rootpool/usr/ports/distfiles? >=20 > 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 SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec off tem= porary > rootpool/usr/ports/distfiles setuid on def= ault > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, > noexec, nosuid) >=20 > mount can't get rid of these options. >=20 > hp010# mount -u -o noatime /usr/ports/distfiles > hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount > | grep distfiles > NAME PROPERTY VALUE SOU= RCE > rootpool/usr/ports/distfiles atime off tem= porary > rootpool/usr/ports/distfiles exec off tem= porary > rootpool/usr/ports/distfiles setuid on def= ault > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, > noatime, noexec, nosuid) >=20 > hp010# mount -u -o atime /usr/ports/distfiles > hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount > | grep distfiles > NAME PROPERTY VALUE SOU= RCE > rootpool/usr/ports/distfiles atime off tem= porary > rootpool/usr/ports/distfiles exec off tem= porary > rootpool/usr/ports/distfiles setuid on def= ault > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, > noatime, noexec, nosuid) >=20 > 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. >=20 > 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 SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec on def= ault > rootpool/usr/ports/distfiles setuid on def= ault > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, nosuid) >=20 >=20 > hp010# zfs set setuid=3Doff rootpool/usr/ports/distfiles > hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount > | grep distfiles > NAME PROPERTY VALUE SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec on def= ault > rootpool/usr/ports/distfiles setuid off loc= al > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, nosuid) >=20 > 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 SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec on def= ault > rootpool/usr/ports/distfiles setuid on def= ault > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local) >=20 > We have now set everything back to the default mount options using 'zfs i= nherit' >=20 > 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 SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec on def= ault > rootpool/usr/ports/distfiles setuid on def= ault > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, nosuid) >=20 > Now mount can't set noatime or noexec. >=20 > 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 SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec on def= ault > rootpool/usr/ports/distfiles setuid on def= ault > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local) >=20 > Back to the defaults again. >=20 > This last part gets a bit strange, without umounting > /usr/ports/distfiles, I tried the following: >=20 > hp010# mount -u -o nosuid /usr/ports/distfiles > hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount > | grep distfiles > NAME PROPERTY VALUE SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec on def= ault > rootpool/usr/ports/distfiles setuid on def= ault > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, nosuid) > hp010# zfs set setuid=3Doff rootpool/usr/ports/distfiles > hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount > | grep distfiles > NAME PROPERTY VALUE SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec on def= ault > rootpool/usr/ports/distfiles setuid off loc= al > 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 SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec on def= ault > rootpool/usr/ports/distfiles setuid on def= ault > 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 SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec off tem= porary > rootpool/usr/ports/distfiles setuid on def= ault > 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 SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec on def= ault > rootpool/usr/ports/distfiles setuid on def= ault > 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 SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec off tem= porary > rootpool/usr/ports/distfiles setuid on def= ault > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, > noexec, nosuid) >=20 > It won't set noatime when noexec and nosuid are specified. >=20 > hp010# mount -u -o noatime /usr/ports/distfiles > hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount > | grep distfiles > NAME PROPERTY VALUE SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec on def= ault > rootpool/usr/ports/distfiles setuid on def= ault > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, nosuid) >=20 > Now it removed noexec, and didn't set noatime. >=20 > 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 SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec on def= ault > rootpool/usr/ports/distfiles setuid on def= ault > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local) >=20 > Lets try setting noatime again: >=20 > hp010# mount -u -o noatime /usr/ports/distfiles > hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount > | grep distfiles > NAME PROPERTY VALUE SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec on def= ault > rootpool/usr/ports/distfiles setuid on def= ault > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, nosuid) >=20 > mount shows nosuid. Lets unset if with zfs inherit: >=20 > 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 SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec on def= ault > rootpool/usr/ports/distfiles setuid on def= ault > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local) >=20 > nosuid is gone, lets see if we can now set noatime: >=20 > hp010# mount -u -o noatime /usr/ports/distfiles > hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount > | grep distfiles > NAME PROPERTY VALUE SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec on def= ault > rootpool/usr/ports/distfiles setuid on def= ault > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, nosuid) >=20 > Again mount is showing nosuid: >=20 > hp010# mount -u -o nonoatime /usr/ports/distfiles > hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount > | grep distfiles > NAME PROPERTY VALUE SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec on def= ault > rootpool/usr/ports/distfiles setuid on def= ault > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, nosuid) > hp010# mount -u -o nonosuid /usr/ports/distfiles > hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount > | grep distfiles > NAME PROPERTY VALUE SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec on def= ault > rootpool/usr/ports/distfiles setuid on def= ault > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, nosuid) >=20 > Try nonoatime and nonosuid, but mount still showing nosuid. Using zfs > inherit gets rid of nosuid: >=20 > 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 SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec on def= ault > rootpool/usr/ports/distfiles setuid on def= ault > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local) >=20 > Give up, and umount the filesystem: >=20 > hp010# umount /usr/ports/distfiles > hp010# zfs mount -a > hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount > | grep distfiles > NAME PROPERTY VALUE SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec on def= ault > rootpool/usr/ports/distfiles setuid on def= ault > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local) > hp010# mount -u -o noatime /usr/ports/distfiles > hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount > | grep distfiles > NAME PROPERTY VALUE SOU= RCE > rootpool/usr/ports/distfiles atime off tem= porary > rootpool/usr/ports/distfiles exec on def= ault > rootpool/usr/ports/distfiles setuid on def= ault > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, noatime) >=20 > We can now set noatime, try nonoatime to unset it: >=20 > hp010# mount -u -o nonoatime /usr/ports/distfiles > hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount > | grep distfiles > NAME PROPERTY VALUE SOU= RCE > rootpool/usr/ports/distfiles atime off tem= porary > rootpool/usr/ports/distfiles exec on def= ault > rootpool/usr/ports/distfiles setuid on def= ault > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, noatime) >=20 > That didn't work, does atime work: >=20 > hp010# mount -u -o atime /usr/ports/distfiles > hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount > | grep distfiles > NAME PROPERTY VALUE SOU= RCE > rootpool/usr/ports/distfiles atime off tem= porary > rootpool/usr/ports/distfiles exec on def= ault > rootpool/usr/ports/distfiles setuid on def= ault > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, noatime) >=20 > Reset atime to defaults with zfs inherit: >=20 > hp010# zfs inherit -r atime rootpool/usr/ports/distfiles > hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount > | grep distfiles > NAME PROPERTY VALUE SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec on def= ault > rootpool/usr/ports/distfiles setuid on def= ault > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local) >=20 > Does nonoatime have any side efects now: >=20 > hp010# mount -u -o nonoatime /usr/ports/distfiles > hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount > | grep distfiles > NAME PROPERTY VALUE SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec on def= ault > rootpool/usr/ports/distfiles setuid on def= ault > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local) >=20 > No side effect, lets try setting noatime: >=20 > hp010# mount -u -o noatime /usr/ports/distfiles > hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount > | grep distfiles > NAME PROPERTY VALUE SOU= RCE > rootpool/usr/ports/distfiles atime on def= ault > rootpool/usr/ports/distfiles exec on def= ault > rootpool/usr/ports/distfiles setuid on def= ault > rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local) > hp010# >=20 > Now mount can't set noatime. Could you file a PR for this? The code responsible for mount options handling changed recently in ZFS, but I don't think I'll be able to integrate it before 7.0-RELEASE. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --AhhlLboLdkugWU4S Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFGu1JqForvXbEpPzQRAiefAKDEOsUjfKTp2A08x4HzK8jiJlrGOgCfajNk vL1V4Ly1vzllwUgkfOm/Wiw= =rsjA -----END PGP SIGNATURE----- --AhhlLboLdkugWU4S--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070809174410.GA9454>