From owner-freebsd-fs@FreeBSD.ORG Fri Jan 13 22:58:08 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 8BFAD16A41F for ; Fri, 13 Jan 2006 22:58:08 +0000 (GMT) (envelope-from user@dhp.com) Received: from shell.dhp.com (shell.dhp.com [199.245.105.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 22BEB43D48 for ; Fri, 13 Jan 2006 22:58:04 +0000 (GMT) (envelope-from user@dhp.com) Received: by shell.dhp.com (Postfix, from userid 896) id 9741B312F5; Fri, 13 Jan 2006 17:57:59 -0500 (EST) Date: Fri, 13 Jan 2006 17:57:59 -0500 (EST) From: user To: Eric Anderson In-Reply-To: <43C819C1.1060706@centtech.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-fs@freebsd.org Subject: Re: preventing deadlocks in snapshot directories - unexplained X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2006 22:58:08 -0000 On Fri, 13 Jan 2006, Eric Anderson wrote: > What happens if you do: > > rm -f snap_directory1/snapshot > rmdir snap_directory1 > > Does the same thing happen? I will try that as I try to reproduce the problem. I am aware that there are two "lags" when creating a snapshot - the lock that occurs in the snapshot directory for the entire course of creation/destruction, and also a short system-wide lag that occurs for a small portion of the time of creation/destruction. It is possible that on a heavily taxed system, the two could be confused for one another, which is possibly what happened when I noticed the one-deep directory "locking" when I deleted a two-deep directory snapshot. I think the main, conceptual question I am asking is this - what is the difference between these three strategies: #1: /.snap/snapshot1 /.snap/snapshot2 /.snap/snapshot3 #2 /.snap/snapdir1/snapshot1 /.snap/snapdir2/snapshot2 /.snap/snapdir3/snapshot3 #3 /.snap/snapshot1 /.snap2/snapshot2 /.snap3/snapshot3 Now, so far in this thread, some have claimed that #2 and #3 are identical, which seems reasonable. My only problem is that I _think_ I am seeing problems with #2. We'll see. However, what about #1 above ? In that case, all of the snapshots are in one directory, and I feel that this is dangerous, or at least poorly done - isn't there a very real possibility of a deadlock there, because you could be creating a snapshot in /.snap at the same time as you delete one (or create a different one ?) The man page says nothing about multiple snapshots, etc., and I want to know if, one way or another, it is a good instinct on my part to make sure multiple snapshots do not end up in the exact same directory... thanks.