delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/09/14/12:39:32

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <4C8FA533.10306@ixiacom.com>
Date: Tue, 14 Sep 2010 09:39:15 -0700
From: Earl Chew <echew AT ixiacom DOT com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.9) Gecko/20100825 Thunderbird/3.1.3
MIME-Version: 1.0
To: <cygwin AT cygwin DOT com>
Subject: Re: Deletion race in NtSetFileInformation ? (Directory not empty error in rm -r -f)
References: <20100914083821 DOT GF16534 AT calimero DOT vinschen DOT de>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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

> 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

- Raw text -


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