X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 	tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS
X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
From: Eric Blake <ebb9@byu.net>
Subject:  Re: MVFS results
Date: Fri, 17 Jul 2009 23:15:03 +0000 (UTC)
Lines: 31
Message-ID:  <loom.20090717T230701-727@post.gmane.org>
References:  <loom.20090715T192219-408@post.gmane.org> <20090715204831.GA27613@calimero.vinschen.de> <loom.20090715T213245-387@post.gmane.org>
Mime-Version:  1.0
Content-Type:  text/plain; charset=us-ascii
Content-Transfer-Encoding:  7bit
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Eric Blake <ebb9 <at> byu.net> writes:

> > As I said above, I assume that MVFS has a problem similar to what we
> > have for remote HPFS.  It's not sufficient to set only the minimal
> > set of access flags in calls to NtCreateFile/NtOpenFile in some
> > circumstances.  I can't tell where the problem is for cp -p since that
> > shouldn't call anything different from touch in terms of setting timestamps.
> 
> utimensat vs utimens?

Found the root cause.  R/O vs. writeable.  Doesn't matter where the source file 
lives; rather, the utimens call is failing because cp is changing the 
permissions to R/O prior to changing the times, all while keeping the same fd 
open that was used for populating the copy.  But touch starts from a closed fd, 
which is enough of a different path to trigger the workaround path that 
temporarily removes the R/O bit to change the time and then turn the bit back 
on.  Is that enough for you to go on, or do I need to also give strace details?

$ echo hi > /tmp/bar
$ touch -d yesterday /tmp/bar
$ cp -p /tmp/bar bar1
$ chmod a-w /tmp/bar
$ cp -p /tmp/bar bar2
$ ls -l bar?
-rw-r--r-- 1 eblake Domain Users 3 Jul 16 17:12 bar1
-r--r--r-- 1 eblake Domain Users 3 Jul 17 17:12 bar2

-- 
Eric Blake




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

