From owner-svn-src-all@FreeBSD.ORG Fri Jun 27 20:18:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE005DD3; Fri, 27 Jun 2014 20:18:33 +0000 (UTC) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73894285D; Fri, 27 Jun 2014 20:18:32 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.9/8.14.2) with ESMTP id s5RJq1Ht052124; Fri, 27 Jun 2014 13:52:01 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.9/8.14.9/Submit) id s5RJq1DF052123; Fri, 27 Jun 2014 13:52:01 -0600 (MDT) (envelope-from ken) Date: Fri, 27 Jun 2014 13:52:01 -0600 From: "Kenneth D. Merry" To: Xin LI 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> References: <201308212304.r7LN4mr6058450@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "svn-src-head@freebsd.org" , Craig Rodrigues , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jun 2014 20:18:34 -0000 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