Date: Fri, 13 Jan 2006 08:39:42 -0600 From: Eric Anderson <anderson@centtech.com> To: freebsd-fs@freebsd.org Subject: Re: preventing deadlocks in snapshot directories - unexplained Message-ID: <43C7BBAE.4040600@centtech.com> In-Reply-To: <200601131334.k0DDYZEA024957@lurza.secnetix.de> References: <200601131334.k0DDYZEA024957@lurza.secnetix.de>
next in thread | previous in thread | raw e-mail | index | archive | help
Oliver Fromme wrote: > user <user@dhp.com> wrote: > > I have asked this before, but nobody answered ... > > Many people tend to be reluctant answering questions > from anonymous users (or they don't bother reading their > questions at all). > > > If you have multiple snapshots, how do you segregate them in order to > > avoid the deadlocks that the ".snap" directory is supposed to fix ? > > As far as I know, using that directory is just a matter of > convention. You can place snapshots anywhere else, and it > doesn't make a difference. The only thing special about > ".snap" is that it is created by default by newfs(1), and > it is expected to exist by the snapshot support of the > dump(8) and fsck(8) tools (for dumping live file systems > and background fsck, respectively). > > > I understand why a snapshot is created in (mount)/.snap - but what if I > > have multiple snapshots running simultaneously ? > > It doesn't make a difference. > > > 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, which > can take quite some time, depending on the size of the > file system, because a lot of data has to be updated. > So, that blocking is to be expected (unfortunately). > > > So, this leads me to conclude that actually, I need to do this: > > > > /.snap/snapshot_file > > /.snap2/snapshot_file > > /.snap3/snapshot_file > > No, it doesn't make a difference. As far as I know, the > snapshot code doesn't care about the directory name where > the snapshot files are placed. > 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. 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. Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43C7BBAE.4040600>