Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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 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 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 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/