This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Deletion race in NtSetFileInformation ? (Directory not empty error in rm -r -f)
- From: Earl Chew <echew at ixiacom dot com>
- To: <cygwin at cygwin dot com>
- Date: Tue, 14 Sep 2010 09:39:15 -0700
- Subject: Re: Deletion race in NtSetFileInformation ? (Directory not empty error in rm -r -f)
- References: <20100914083821.GF16534@calimero.vinschen.de>
> There shouldn't be any race. When you set the delete disposition,
> the file is actually deleted as soon as the last handle to the file
> is closed. If the file isn't opened by another process, it will
> disappear right at the NtClose at the end of unlink_nt. Please note
> that the call to check_dir_not_empty already takes place *only* if
> trying to open the directory failed with STATUS_SHARING_VIOLATION.
> So there *was* another process blocking things.
Corinna,
Yes, I noticed that check wrt STATUS_SHARING_VIOLATION.
These actions are performed consequential to a shell script,
that launches a Makefile, that performs the rm -r -f ... so within
that context there is definitely scope for oversight and we
might inadvertently have a process getting in the way.
When you describe the other process blocking things, what might
that other process be doing?
I presume that other process having the directory in question
open, or as cwd is sufficient.
Is there anything else I should be on the lookout for?
Earl
--
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