Date: Fri, 27 Jun 2014 13:52:01 -0600 From: "Kenneth D. Merry" <ken@FreeBSD.ORG> To: Xin LI <delphij@gmail.com> Cc: "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, Craig Rodrigues <rodrigc@ixsystems.com>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "src-committers@freebsd.org" <src-committers@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: <20140627195201.GA52113@nargothrond.kdm.org> In-Reply-To: <CAGMYy3tDPqOjQxvZ3S0ER%2B5YMNUOpKXpY6NTOtbSV1WtvyPBXg@mail.gmail.com> References: <201308212304.r7LN4mr6058450@svn.freebsd.org> <CAGMYy3tDPqOjQxvZ3S0ER%2B5YMNUOpKXpY6NTOtbSV1WtvyPBXg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jun 27, 2014 at 12:48:29 -0700, Xin LI wrote: > 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; Yes, that sounds like a good way to do it. Ken -- Kenneth Merry ken@FreeBSD.ORG
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140627195201.GA52113>