public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nigel Cunningham <nigel@nigel.suspend2.net>
To: Oliver Neukum <oliver@neukum.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>, Pavel Machek <pavel@ucw.cz>,
	Kyle Moffett <mrmacman_g4@mac.com>,
	Matthew Garrett <mjg59@srcf.ucam.org>,
	David Chinner <dgc@sgi.com>,
	Jeremy Fitzhardinge <jeremy@goop.org>,
	xfs-masters@oss.sgi.com,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: freeze vs freezer
Date: Thu, 03 Jan 2008 20:52:53 +1100	[thread overview]
Message-ID: <477CB075.5080507@nigel.suspend2.net> (raw)
In-Reply-To: <200801031047.58559.oliver@neukum.org>

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

  reply	other threads:[~2008-01-03  9:53 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-22  3:54 freeze vs freezer Jeremy Fitzhardinge
2007-11-23 23:47 ` Rafael J. Wysocki
2007-11-26 18:44   ` Jeremy Fitzhardinge
2007-11-26 21:20     ` Rafael J. Wysocki
2007-11-26 21:17   ` David Chinner
2007-11-26 21:53     ` Rafael J. Wysocki
2007-11-27  5:38       ` Matthew Garrett
2007-11-27 17:40         ` Rafael J. Wysocki
2007-11-27 20:33           ` Kyle Moffett
2007-11-27 23:01             ` Rafael J. Wysocki
2007-11-27 22:49               ` Jeremy Fitzhardinge
2007-11-27 23:14                 ` Kyle Moffett
2007-11-27 23:32                   ` Jeremy Fitzhardinge
2008-01-02 16:02             ` Pavel Machek
2008-01-02 21:30               ` Nigel Cunningham
2008-01-02 22:04                 ` Rafael J. Wysocki
2008-01-03  9:19                   ` Nigel Cunningham
2008-01-03  9:47                     ` Oliver Neukum
2008-01-03  9:52                       ` Nigel Cunningham [this message]
2008-01-03 11:15                         ` Oliver Neukum
2008-01-03 22:06                           ` Nigel Cunningham
2008-01-04 20:54                             ` Oliver Neukum
2008-01-05  1:38                               ` Kyle Moffett
2008-01-05 21:18                               ` Pavel Machek
2008-01-05 23:01                                 ` Nigel Cunningham
2008-01-03 22:31                     ` Rafael J. Wysocki
2008-06-23  7:16             ` Pavel Machek
2008-06-23 14:00               ` Henrique de Moraes Holschuh
2008-06-24  8:08                 ` Elias Oltmanns
2008-06-26 15:09                   ` Pavel Machek
2008-06-29 22:12                     ` [xfs-masters] " Dave Chinner
2008-06-29 23:22                       ` Rafael J. Wysocki
2008-06-30  6:11                         ` Christoph Hellwig
2008-06-30 20:34                           ` Rafael J. Wysocki
2008-07-03 19:43                             ` Eric Sandeen
2008-06-30  6:29                         ` Dave Chinner
2008-06-30  6:37                           ` Jeremy Fitzhardinge
2008-06-30 12:33                             ` Dave Chinner
2008-06-30 21:00                               ` Rafael J. Wysocki
2008-06-30 22:21                                 ` Dave Chinner
2008-06-30 22:38                                   ` Rafael J. Wysocki
2008-07-01  6:38                                     ` Dave Chinner
2008-07-01 14:35                                       ` Rafael J. Wysocki
2008-07-01 15:05                                         ` Elias Oltmanns
2008-07-01 15:17                                           ` Christoph Hellwig
2008-07-01 21:15                                           ` Dave Chinner
2008-07-01 21:46                                             ` Elias Oltmanns
2008-07-01 21:12                                         ` Dave Chinner
2008-07-01 21:21                                           ` Rafael J. Wysocki
2008-07-01  8:59                             ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=477CB075.5080507@nigel.suspend2.net \
    --to=nigel@nigel.suspend2.net \
    --cc=dgc@sgi.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=mrmacman_g4@mac.com \
    --cc=oliver@neukum.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@sisk.pl \
    --cc=xfs-masters@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox