www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/08/28/11:00:32

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Eric Blake <ebb9 AT byu DOT net>
Subject: unlink()/rmdir() on busy file on MVFS
Date: Fri, 28 Aug 2009 14:59:52 +0000 (UTC)
Lines: 75
Message-ID: <loom.20090828T164628-598@post.gmane.org>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
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

I noticed this inconsistency:

shell 1:
$ df -T /cygdrive/[mu]
Filesystem    Type   1K-blocks      Used Available Use% Mounted on
M:            mvfs     1024000    512000    512000  50% /cygdrive/m
U:           smbfs    83886080  76761088   7124992  92% /cygdrive/u
$ cd /cygdrive/u
$ mkdir dir
$ touch dir/f

shell 2:
$ cd /cygdrive/u/dir
$ exec 3<f

shell 1:
$ rm dir/f
rm: cannot remove `dir/f': Device or resource busy
$ rmdir dir
rmdir: failed to remove `dir': Directory not empty

shell 2:
$ exec 3<&-
$ cd ..

shell 1:
$ rm dir/f
$ rmdir dir
$

So far, so good - since we can't delete in-use objects on remote systems, this 
is nice behavior.  But repeat the test on MVFS, and:

$ cd /cygdrive/m
$ mkdir dir
$ touch dir/f

shell 2:
$ cd /cygdrive/m/dir
$ exec 3<f

shell 1:
$ rm dir/f
$ ls dir
f

shell 2:
$ exec 3<&-

shell 1:
$ ls dir
$ rmdir dir
$ ls -d dir
dir

shell 2:
$ ls
ls: cannot open directory .: Permission denied
$ cd ..

shell 1:
$ ls -d dir
ls: cannot access dir: No such file or directory

Yes, the file and directory are being closed when the last client closes its 
handles, but it leads to confusing non-posix semantics in the meantime.

Any advice on what to try to make MVFS behave like other remote fs to reject 
deletion of in-use objects?  Or do we just leave it alone, since we've already 
faced more than our fair share of working around MVFS anomalies?

-- 
Eric Blake




--
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