delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/10/19/11:46:33

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Wed, 19 Oct 2011 17:45:40 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: rm -rf cannot delete the upmost directory level anymore on a Novell share
Message-ID: <20111019154540.GE22809@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <4E9EE8CC DOT 5090806 AT lauterbach DOT com>
MIME-Version: 1.0
In-Reply-To: <4E9EE8CC.5090806@lauterbach.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
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

On Oct 19 17:12, Franz Sirl wrote:
> Hi,
> 
> sometime between coreutils-7.0 and coreutils-8.4 (sorry, I don't
> have any other in between versions anymore) this simple command
> started to fail:
> 
> # mkdir -p lev1/lev2/lev3
> # rm -rfv lev1
> removed directory: `lev1/lev2/lev3'
> removed directory: `lev1/lev2'
> rm: cannot remove `lev1': Device or resource busy
> 
> Tested with coreutils-8.10 and cygwin1.dll from the 20111017
> snapshot, as the cygwin1.dll didn't make any difference for the
> problem.
> 
> If I just use rm.exe from coreutils-7.0 everything starts to work as
> expected again:
> 
> # mkdir -p lev1/lev2/lev3
> # rm -rfv lev1
> removed directory: `lev1/lev2/lev3'
> removed directory: `lev1/lev2'
> removed directory: `lev1'

The problem is, it works fine on local and remote NTFS, as well as on
Samba.  Since the number of open handles doesn't depend on the underlying
filesystem, why should it fail for NWFS?

> Looking at the strace output of both rm-7.0 and rm-8.10 it seems
> that rm-8.10 thinks that lev1 is a file, because it uses unlink_nt()
> first.

unlink_nt is used by unlink as well as by rmdir since the system calls
to delete a file are the same as the calls to delete a directory.

>   216  174576 [main] rm-8.10 336 unlink_nt: Opening file for delete
> failed, status = 0xC0000043
>   240  174816 [main] rm-8.10 336 seterrno_from_nt_status: /netrel/src/cygwin-snapshot-20111017-1/winsup/cygwin/fhandler_disk_file.cc:1735
> status 0xC0000043 -> windows error 32

That's a sharing violation.  Where's the difference to the strace
output with the exact same Cygwin DLL and rm from coreutils 7?


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

- Raw text -


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