From owner-svn-src-all@FreeBSD.ORG Fri Jun 27 19:48: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 667D4C26; Fri, 27 Jun 2014 19:48:33 +0000 (UTC) Received: from mail-la0-x22e.google.com (mail-la0-x22e.google.com [IPv6:2a00:1450:4010:c03::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B4152573; Fri, 27 Jun 2014 19:48:32 +0000 (UTC) Received: by mail-la0-f46.google.com with SMTP id el20so3243157lab.5 for ; Fri, 27 Jun 2014 12:48:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=i2+PMrxdRL0G14qgTFNaotKjoFfkxOVW0ocbg0noiU8=; b=jCfpoxaVgRJCd0urk8xHzXfcxAqeQV3UZTVX1EJBmDAOyEimWK1199zx+JWBWyACls YzZZAPQalSh4/VSBOh6RtBbmuUsxc6cvLtPr0FX+afQmb/9pto2vZlI4E0CSgMrXhJ2U Lo+sF/6jwQsTkkvhhBYhhwyWzC4IoLfhScr+0X2hk9Ur8xpl4LRKSJs3cBCqgJSnt3UB Gluzc7z+cQHYcmwCN6FCAjewvIXOS3BUb0EqkbiYjMpFEFDJlQ4YBs2VpeGs6JIgmj7g UZehfuXWrbSqzthLICi5jK5HsF48VNsQdLU3QJYzbrUg9RUkw/uIF09Gl+ZYbSqmNnPM w5nQ== MIME-Version: 1.0 X-Received: by 10.152.1.228 with SMTP id 4mr3077370lap.69.1403898509943; Fri, 27 Jun 2014 12:48:29 -0700 (PDT) Received: by 10.114.63.106 with HTTP; Fri, 27 Jun 2014 12:48:29 -0700 (PDT) In-Reply-To: <201308212304.r7LN4mr6058450@svn.freebsd.org> References: <201308212304.r7LN4mr6058450@svn.freebsd.org> Date: Fri, 27 Jun 2014 12:48:29 -0700 Message-ID: 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 From: Xin LI To: "Kenneth D. Merry" , Craig Rodrigues Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: "svn-src-head@freebsd.org" , "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 19:48:33 -0000 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