From owner-freebsd-current@FreeBSD.ORG Thu Aug 9 17:07:10 2007 Return-Path: Delivered-To: FreeBSD-CURRENT@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7A5E16A418 for ; Thu, 9 Aug 2007 17:07:10 +0000 (UTC) (envelope-from swhetzel@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.188]) by mx1.freebsd.org (Postfix) with ESMTP id 34D9213C4E8 for ; Thu, 9 Aug 2007 17:07:10 +0000 (UTC) (envelope-from swhetzel@gmail.com) Received: by nf-out-0910.google.com with SMTP id b2so158504nfb for ; Thu, 09 Aug 2007 10:07:09 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:mime-version:content-type:content-transfer-encoding:content-disposition; b=nntJPzgYdEPyr9riJF1nbtP6x2jq631TPtwwa1sfL8YriCWPs1GOlrW5hp3hFbk2SUolaM15399OZ20k0cIu8VAm3pIt8PSiIyPdABUpfBiOkSD1tejfEsSNxU6jgFMpUJ6errwnAVffd8xtOp5QcmY9f5MXXeTwVeh/Slu8a68= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:mime-version:content-type:content-transfer-encoding:content-disposition; b=umPFdYjlU6WZ85N/AE48TnawZJJdaHeLuj+r49XIlxzsQJJPzeX3heo4ko8eyBxTXIgy6eOhWE1xejK5g6kjGZMyXl8HXJIdnJSoeAFPqRNtGBPMqMO8tVcEnomQ4hozCBVpGloRcPctKOAOd1p7lntl0YE05U25LwxVAZ+rHyo= Received: by 10.86.71.1 with SMTP id t1mr1634138fga.1186679228853; Thu, 09 Aug 2007 10:07:08 -0700 (PDT) Received: by 10.86.59.6 with HTTP; Thu, 9 Aug 2007 10:07:08 -0700 (PDT) Message-ID: <790a9fff0708091007h48cb5133t16638a24076795f8@mail.gmail.com> Date: Thu, 9 Aug 2007 12:07:08 -0500 From: "Scot Hetzel" To: pjd@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Cc: FreeBSD-CURRENT@freebsd.org Subject: mount gets into a state where it won't set/unset ZFS properties (atime, exec, setuid) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2007 17:07:10 -0000 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: 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 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) Lets try setting noatime again: 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) mount shows nosuid. Lets unset if with zfs inherit: 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) nosuid is gone, lets see if we can now set noatime: 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) Again mount is showing nosuid: hp010# mount -u -o nonoatime /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# mount -u -o nonosuid /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) Try nonoatime and nonosuid, but mount still showing nosuid. Using zfs inherit gets rid of 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) Give up, and umount the filesystem: 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 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 /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 on default rootpool/usr/ports/distfiles setuid on default rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, noatime) We can now set noatime, try nonoatime to unset it: hp010# mount -u -o nonoatime /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 on default rootpool/usr/ports/distfiles setuid on default rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, noatime) That didn't work, does atime work: 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 on default rootpool/usr/ports/distfiles setuid on default rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, noatime) Reset atime to defaults with zfs inherit: 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 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) Does nonoatime have any side efects now: hp010# mount -u -o nonoatime /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) No side effect, lets try setting noatime: 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) hp010# Now mount can't set noatime. Scot -- DISCLAIMER: No electrons were mamed while sending this message. Only slightly bruised.