This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: rm -rf cannot delete the upmost directory level anymore on a Novell share


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]