Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
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
Date: Wed, 9 Feb 2005 20:28:12 +0100
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: snapshots are breaking shred
Message-ID: <20050209192812.GU2597@cygbert.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <020920051745.590.420A4C2A000CF0230000024E22058864420A050E040D0C079D0A@comcast.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <020920051745.590.420A4C2A000CF0230000024E22058864420A050E040D0C079D0A@comcast.net>
User-Agent: Mutt/1.4.2i

On Feb  9 17:45, ericblake@comcast.net wrote:
> With coreutils 5.3.0-2 and various snapshots, I am seeing regressions in shred(1)caused by cygwin changes:
> [...]
> $ echo a > a
> $ shred --remove a
> shred: a: error truncating
> [...]
> 20050206 introduced Corinna's changes to ftruncate, which might explain the
> current failure.  I don't know when fsync regressed between 1.5.12 and
> 20050131, and it is probably still broken in 20050208 since shred bypasses
> the final fsync on . after detecting the earlier error on ftruncate.  The
> following strace chunk shows that fd 3 (assigned to "./a") was open for
> writing as evidenced by the successful writev, so ftruncate should have
> succeeded instead of dying with EBADF:

Ouch, ouch, ouch!  I see the problem.  I'm testing for > 0 where I should
have tested for >= 0.  This brakes ftruncate when length is set to 0.

As far as fsync is affected, I don't see how that could ever fail, except
the Windows call fails for some reason.  The fsync code hasn't changed
for quite some time.

Thanks for the report, I've checked in a patch,
Corinna


-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          mailto:cygwin@cygwin.com
Red Hat, Inc.

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

