Date: Wed, 28 Aug 2013 15:54:18 -0500 From: Bryan Drewery <bryan@shatow.net> To: svn-src-all@freebsd.org, ken@FreeBSD.org Cc: swills@FreeBSD.org, antoine@FreeBSD.org, madpilot@FreeBSD.org, kwm@FreeBSD.org Subject: Re: svn commit: r254627 - in head: bin/chflags bin/ls lib/libc/gen lib/libc/sys sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/fs/msdosfs sys/fs/smbfs sys/sys sys/ufs/ufs Message-ID: <13d31864e269b87bbf573d33b0bb6494@shatow.net> In-Reply-To: <201308212304.r7LN4mr6058450@svn.freebsd.org> References: <201308212304.r7LN4mr6058450@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2013-08-21 18:04, Kenneth D. Merry wrote: > Author: ken > Date: Wed Aug 21 23:04:48 2013 > New Revision: 254627 > URL: http://svnweb.freebsd.org/changeset/base/254627 > > Log: > Expand the use of stat(2) flags to allow storing some Windows/DOS > and CIFS file attributes as BSD stat(2) flags. > > This work is intended to be compatible with ZFS, the Solaris CIFS > server's interaction with ZFS, somewhat compatible with MacOS X, > and of course compatible with Windows. > > The Windows attributes that are implemented were chosen based on > the attributes that ZFS already supports. > > The summary of the flags is as follows: [...] > > UF_ARCHIVE: Command line name: "uarch", "uarchive" > ZFS_NAME: XAT_ARCHIVE, ZFS_ARCHIVE > Windows name: FILE_ATTRIBUTE_ARCHIVE > > The UF_ARCHIVED flag means that the file has changed and > needs to be archived. The meaning is same as > the Windows FILE_ATTRIBUTE_ARCHIVE attribute, and > the ZFS XAT_ARCHIVE and ZFS_ARCHIVE attribute. > > msdosfs and ZFS have special handling for this flag. > i.e. they will set it when the file changes. Is it intended that this flag is automatically added to all new and existing ZFS files? # touch test # ls -alo test -rw-r--r--- 1 root wheel uarch 0 Aug 28 15:46 test This breaks 'cp -p' to tmpfs as tmpfs does not allow this flag. # mkdir /tmp/tmpfs # mount -t tmpfs tmpfs /tmp/tmpfs # cp -f test /tmp/tmpfs cp: test: Operation not supported [...] > Modified: head/sys/ufs/ufs/ufs_vnops.c > ============================================================================== > --- head/sys/ufs/ufs/ufs_vnops.c Wed Aug 21 22:57:29 2013 (r254626) > +++ head/sys/ufs/ufs/ufs_vnops.c Wed Aug 21 23:04:48 2013 (r254627) > @@ -528,9 +528,11 @@ ufs_setattr(ap) > return (EINVAL); > } > if (vap->va_flags != VNOVAL) { > - if ((vap->va_flags & ~(UF_NODUMP | UF_IMMUTABLE | UF_APPEND | > - UF_OPAQUE | UF_NOUNLINK | SF_ARCHIVED | SF_IMMUTABLE | > - SF_APPEND | SF_NOUNLINK | SF_SNAPSHOT)) != 0) > + if ((vap->va_flags & ~(SF_APPEND | SF_ARCHIVED | SF_IMMUTABLE | > + SF_NOUNLINK | SF_SNAPSHOT | UF_APPEND | UF_ARCHIVE | > + UF_HIDDEN | UF_IMMUTABLE | UF_NODUMP | UF_NOUNLINK | > + UF_OFFLINE | UF_OPAQUE | UF_READONLY | UF_REPARSE | > + UF_SPARSE | UF_SYSTEM)) != 0) > return (EOPNOTSUPP); > if (vp->v_mount->mnt_flag & MNT_RDONLY) > return (EROFS); Seems a similar change is needed in tmpfs_subr.c:tmpfs_chflags() (antoine pointed this out)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?13d31864e269b87bbf573d33b0bb6494>