X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Tue, 20 Mar 2012 21:50:03 +0100
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: ftell() fails on files in shared folders
Message-ID: <20120320205003.GJ18032@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <CAJOtW+5qwWvN84mJJ=NR3TgZE5s7jz8jpLTaN=+h1hv5Ob29XQ@mail.gmail.com> <20120318155829.GA21914@calimero.vinschen.de> <CAJOtW+4fMX_EEOBWhn0d6VPU7oq+k_Rx1CGYe4O16ccsNRV4ZA@mail.gmail.com> <CAJOtW+4ZCvk3NarGn1qOFF-A+ZbFjithPJE8Ms-7FNFMH63A7Q@mail.gmail.com> <20120318191043.GA32177@calimero.vinschen.de> <CAJOtW+4UcSdbOqfch8Kzjh90FJP5ebtx-JJ7t8pGV2QZXiQ69A@mail.gmail.com> <20120319091408.GA30682@calimero.vinschen.de> <CAJOtW+5Mf9uYfe6x8+HsDxWyUmT11DFvDAs1QE00uj5uOayfaA@mail.gmail.com> <20120320120923.GB20228@calimero.vinschen.de> <CAJOtW+5iABpBo3FSLHp6ESn-P6ZetT1Xe-gVT10n4G-1aJX4pA@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <CAJOtW+5iABpBo3FSLHp6ESn-P6ZetT1Xe-gVT10n4G-1aJX4pA@mail.gmail.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@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

On Mar 21 00:12, Yuri Gribov wrote:
> > First of all, there's a bug in your testcase.
> 
> Nice catch. With fixed code O_RDWR and O_WRONLY no longer influence
> the result but the bug still remains.
> 
> > What filesystem is your remote FS?  Please run
> 
> Done. All nodes seem to have same volume attributes.
> 
> > You could also run the testcase under strace, like this:
> 
> Done, here's the relevant part: for local (successful) run:
>   write: write(3, 0x402080, 8)
>   write: 8 = write(3, 0x402080, 8)
>   fhandler_base::lseek: setting file pointer to 8
>   lseek64: 8 = lseek(0, 3, 0)
>   fhandler_base::lseek: setting file pointer to 8
>   lseek64: 8 = lseek(0, 3, 0)
> and for remote:
>   write: write(3, 0x402080, 8)
>   write: 8 = write(3, 0x402080, 8)
>   fhandler_base::lseek: setting file pointer to 0
>   lseek64: 0 = lseek(0, 3, 0)

Apart from the bug in Cygwin's debug output, the problem is obviously
that your remote filesystem returns 0 as the current file size.  I have
no idea why it does that, and why only on your system.  What OS are
your remote filesystems running on?  I tried on Windows 2008, 7, and
2008R2 in every from<->to combination.

Can anybody else on this list observe this behaviour?


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
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

