From owner-freebsd-fs@FreeBSD.ORG Fri Jan 13 17:54:38 2006 Return-Path: X-Original-To: freebsd-fs@FreeBSD.ORG Delivered-To: freebsd-fs@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1CE2916A41F for ; Fri, 13 Jan 2006 17:54:38 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0F14D43D49 for ; Fri, 13 Jan 2006 17:54:36 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (uhktgb@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id k0DHsYnb033840 for ; Fri, 13 Jan 2006 18:54:35 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id k0DHsYuN033839; Fri, 13 Jan 2006 18:54:34 +0100 (CET) (envelope-from olli) Date: Fri, 13 Jan 2006 18:54:34 +0100 (CET) Message-Id: <200601131754.k0DHsYuN033839@lurza.secnetix.de> From: Oliver Fromme To: freebsd-fs@FreeBSD.ORG In-Reply-To: <43C7BBAE.4040600@centtech.com> X-Newsgroups: list.freebsd-fs User-Agent: tin/1.5.4-20000523 ("1959") (UNIX) (FreeBSD/4.11-STABLE (i386)) Cc: Subject: Re: preventing deadlocks in snapshot directories - unexplained X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-fs@FreeBSD.ORG List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2006 17:54:38 -0000 Eric Anderson wrote: > Oliver Fromme wrote: > > user wrote: > > > cd /.snap > > > rm -rf snap3 > > > > > > the _entire_ /.snap directory locks up until that command completes. > > > > Well, yes, certain file system operations are blocked > > until the removal of the snapshot is complete > > Well, its ok to put snapshots anywhere, but when operations on a > snapshot file are in progress, stat calls on the snapshot file will > block. I think this is his problem. Yes, very probably. > I wonder how painful it would be > to have stat's on snapshot files return with (something) when a snapshot > operation is in progress, instead of blocking, or even if that is possible. I don't think it would be very painful to modify the code so it returns a cached (or even completely faked) copy of the snapshot file's stat structure, instead of blocking. (Disclaimer: I haven't had a closer look at the code.) On a related note, Netapp filers have the ability to hide the snapshot directory. You can still cd into it and access files within it (provided you know their full path), but it doesn't appear in directory listings. That feature prevents innocent "ls -lR", find(1) and other recursive commands from accidentally entering the snapshot directory, and it is also excluded from shell globbing. It would be very useful for FreeBSD to behave the same, too, possibly controlled by a sysctl. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "Python is an experiment in how much freedom programmers need. Too much freedom and nobody can read another's code; too little and expressiveness is endangered." -- Guido van Rossum