delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/02/09/14:28:25

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Wed, 9 Feb 2005 20:28:12 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: snapshots are breaking shred
Message-ID: <20050209192812.GU2597@cygbert.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <020920051745 DOT 590 DOT 420A4C2A000CF0230000024E22058864420A050E040D0C079D0A AT comcast DOT net>
Mime-Version: 1.0
In-Reply-To: <020920051745.590.420A4C2A000CF0230000024E22058864420A050E040D0C079D0A@comcast.net>
User-Agent: Mutt/1.4.2i

On Feb  9 17:45, ericblake AT comcast DOT 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 AT cygwin DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019