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

Xin LI delphij at gmail.com
Fri Jun 27 19:48:33 UTC 2014


Hi,

Craig have hit an interesting issue today, where he tried to 'mv' a file
from ZFS dataset to a NFS mount, 'mv' bails out because chflags failed.

I think it's probably sensible to have mv ignoring UF_ARCHIVE, and set the
flag on the target unconditionally?  i.e.:

Index: mv.c
===================================================================
--- mv.c (revision 267940)
+++ mv.c (working copy)
@@ -337,8 +337,8 @@
  * on a file that we copied, i.e., that we didn't create.)
  */
  errno = 0;
- if (fchflags(to_fd, sbp->st_flags))
- if (errno != EOPNOTSUPP || sbp->st_flags != 0)
+ if (fchflags(to_fd, sbp->st_flags | UF_ARCHIVE))
+ if (errno != EOPNOTSUPP || (sbp->st_flags & ~UF_ARCHIVE) != 0)
  warn("%s: set flags (was: 0%07o)", to, sbp->st_flags);

  tval[0].tv_sec = sbp->st_atime;

Cheers,
​


More information about the svn-src-all mailing list