All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nigel Cunningham <ncunningham@crca.org.au>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Josef Bacik <josef@redhat.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	chris.mason@oracle.com, hch@lst.de
Subject: Re: [PATCH] Introduce freeze_super and thaw_super for the fsfreeze ioctl
Date: Wed, 24 Mar 2010 09:31:51 +1100	[thread overview]
Message-ID: <4BA94157.6090907@crca.org.au> (raw)
In-Reply-To: <20100323150923.GI30031@ZenIV.linux.org.uk>

Hi.

On 24/03/10 02:09, Al Viro wrote:
> On Tue, Mar 23, 2010 at 11:03:01AM -0400, Josef Bacik wrote:
>>> sb is an active reference
>>>
>>
>> I don't understand how this is an active reference?  We are talking about
>> s_active right?
>
> It's an opened file, for crying out loud!  If there is anything that makes
> sure that superblock will stay alive, that is it...
>
> And lose the "locked" argument, please.  The sane solution is to make
> get_active_super() return it unlocked and have your freeze_bdev() simply
> grab s_umount.  Unconditionally.  I'll do the first part in #untested in
> a minute or so (and make it grab s_umount in the current variant of code in
> fs/block_dev.c); then your patch would shift taking s_umount down into
> freeze_super().

Since TuxOnIce was mentioned, I guess he's thinking on the following 
routine.

Regards,

Nigel

/**
  * freeze_filesystems - lock all filesystems and force them into a 
consistent
  * state
  * @which:      What combination of fuse & non-fuse to freeze.
  */
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) {
                 FS_PRINTK(KERN_INFO "Considering %s.%s: (root %p, bdev 
%x)",
                         sb->s_type->name ? sb->s_type->name : "?",
                         sb->s_subtype ? sb->s_subtype : "", sb->s_root,
                         sb->s_bdev ? sb->s_bdev->bd_dev : 0);

                 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;
                         FS_PRINTK("Fuse filesystem done.\n");
                         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)) {
                         FS_PRINTK(KERN_INFO "Nope.\n");
                         continue;
                 }

                 FS_PRINTK(KERN_INFO "Freezing %x... ", sb->s_bdev->bd_dev);
                 freeze_bdev(sb->s_bdev);
                 sb->s_flags |= MS_FROZEN;
                 FS_PRINTK(KERN_INFO "Done.\n");
         }

         lockdep_on();
}

  parent reply	other threads:[~2010-03-23 22:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-23 14:22 [PATCH] Introduce freeze_super and thaw_super for the fsfreeze ioctl Josef Bacik
2010-03-23 14:28 ` Al Viro
2010-03-23 14:34   ` Josef Bacik
2010-03-23 14:48     ` Al Viro
2010-03-23 15:03       ` Josef Bacik
2010-03-23 15:09         ` Al Viro
2010-03-23 15:12           ` Al Viro
2010-03-23 15:15             ` Al Viro
2010-03-23 22:31           ` Nigel Cunningham [this message]
2010-03-23 23:18             ` Al Viro
2010-03-23 23:47               ` Al Viro
2010-03-23 23:52               ` Nigel Cunningham
2010-03-23 23:55                 ` Nigel Cunningham
2010-03-24  0:21                   ` Al Viro
2010-03-24  0:25                     ` Nigel Cunningham
2010-03-24  0:03               ` Nigel Cunningham
2010-03-23 18:19 ` Sunil Mushran
2010-03-23 22:25 ` Nigel Cunningham
2010-03-24  1:17   ` Josef Bacik
2010-03-24  5:16     ` Nigel Cunningham

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=4BA94157.6090907@crca.org.au \
    --to=ncunningham@crca.org.au \
    --cc=chris.mason@oracle.com \
    --cc=hch@lst.de \
    --cc=josef@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.