Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756880AbYACJxR (ORCPT ); Thu, 3 Jan 2008 04:53:17 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754546AbYACJxA (ORCPT ); Thu, 3 Jan 2008 04:53:00 -0500 Received: from home.nigel.suspend2.net ([203.171.70.205]:33094 "EHLO server1.example.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754494AbYACJxA (ORCPT ); Thu, 3 Jan 2008 04:53:00 -0500 Message-ID: <477CB075.5080507@nigel.suspend2.net> Date: Thu, 03 Jan 2008 20:52:53 +1100 From: Nigel Cunningham Reply-To: nigel@nigel.suspend2.net User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Oliver Neukum CC: "Rafael J. Wysocki" , Pavel Machek , Kyle Moffett , Matthew Garrett , David Chinner , Jeremy Fitzhardinge , xfs-masters@oss.sgi.com, Linux Kernel Mailing List Subject: Re: freeze vs freezer References: <4744FD87.7010301@goop.org> <200801022304.19279.rjw@sisk.pl> <477CA8A8.2090201@nigel.suspend2.net> <200801031047.58559.oliver@neukum.org> In-Reply-To: <200801031047.58559.oliver@neukum.org> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2089 Lines: 62 Hi. Oliver Neukum wrote: > Am Donnerstag 03 Januar 2008 schrieb Nigel Cunningham: >> On top of this, I made a (too simple at the moment) freeze_filesystems >> function which iterates through &super_blocks in reverse order, freezing >> fuse filesystems or ordinary ones. I say 'too simple' because it doesn't >> currently allow for the possibility of someone mounting (say) ext3 on >> fuse, but that would just be an extension of what's already done. > > How do you deal with fuse server tasks using other fuse filesystems? Since they're frozen in reverse order, the dependant one would be frozen first. > How does freeze_filesystems() look? Removing my ugly debugging statements, it's currently: /** * freeze_filesystems - lock all filesystems and force them into a consistent * state */ void freeze_filesystems(int which) { struct super_block *sb; lockdep_off(); /* * Freeze in reverse order so filesystems dependant upon others are * frozen in the right order (eg. loopback on ext3). */ list_for_each_entry_reverse(sb, &super_blocks, s_list) { if (sb->s_type->fs_flags & FS_IS_FUSE && sb->s_frozen == SB_UNFROZEN && which & FS_FREEZER_FUSE) { sb->s_frozen = SB_FREEZE_TRANS; sb->s_flags |= MS_FROZEN; continue; } if (!sb->s_root || !sb->s_bdev || (sb->s_frozen == SB_FREEZE_TRANS) || (sb->s_flags & MS_RDONLY) || (sb->s_flags & MS_FROZEN) || !(which & FS_FREEZER_NORMAL)) continue; freeze_bdev(sb->s_bdev); sb->s_flags |= MS_FROZEN; } lockdep_on(); } Nigel -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/