Date: Fri, 27 Jun 2014 12:48:29 -0700 From: Xin LI <delphij@gmail.com> To: "Kenneth D. Merry" <ken@freebsd.org>, Craig Rodrigues <rodrigc@ixsystems.com> Cc: "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "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: <CAGMYy3tDPqOjQxvZ3S0ER%2B5YMNUOpKXpY6NTOtbSV1WtvyPBXg@mail.gmail.com> 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
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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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 =3D 0; - if (fchflags(to_fd, sbp->st_flags)) - if (errno !=3D EOPNOTSUPP || sbp->st_flags !=3D 0) + if (fchflags(to_fd, sbp->st_flags | UF_ARCHIVE)) + if (errno !=3D EOPNOTSUPP || (sbp->st_flags & ~UF_ARCHIVE) !=3D 0) warn("%s: set flags (was: 0%07o)", to, sbp->st_flags); tval[0].tv_sec =3D sbp->st_atime; Cheers, =E2=80=8B
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGMYy3tDPqOjQxvZ3S0ER%2B5YMNUOpKXpY6NTOtbSV1WtvyPBXg>