All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Jan Kara <jack@suse.cz>
Cc: LKML <linux-kernel@vger.kernel.org>,
	linux-fsdevel@vger.kernel.org, Dave Chinner <david@fromorbit.com>,
	mpatocka@redhat.com, Eric Sandeen <sandeen@sandeen.net>
Subject: Re: [PATCH 1/2] vfs: Provide function to get superblock and wait for it to thaw
Date: Sun, 12 Feb 2012 21:13:25 +0000	[thread overview]
Message-ID: <20120212211325.GT23916@ZenIV.linux.org.uk> (raw)
In-Reply-To: <1328868181-16979-2-git-send-email-jack@suse.cz>

On Fri, Feb 10, 2012 at 11:03:00AM +0100, Jan Kara wrote:
> In quota code we need to find a superblock corresponding to a device and wait
> for superblock to be unfrozen. However this waiting has to happen without
> s_umount semaphore because that is required for superblock to thaw. So provide
> a function in VFS for this to keep dances with s_umount where they belong.

Eww...  All it takes is
struct super_block *get_super_thawed(struct block_device *bdev)
{
        while (1) {
                struct super_block *s = get_super(bdev);
                if (!s || s->s_frozen == SB_UNFROZEN)
                        return s;
		up_read(&s->s_umount);
		vfs_check_frozen(s, SB_FREEZE_WRITE);
		put_super(s);
        }
}
and there's no need of extra arguments, etc. whatsoever.  Both patches
applied, with implementation of get_super_thawed() done as above.

  reply	other threads:[~2012-02-12 21:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-10 10:02 [PATCH 0/2 v2] Fix deadlock with suspend & quotas Jan Kara
2012-02-10 10:03 ` [PATCH 1/2] vfs: Provide function to get superblock and wait for it to thaw Jan Kara
2012-02-12 21:13   ` Al Viro [this message]
2012-02-13 14:24     ` Jan Kara
2012-02-10 10:03 ` [PATCH 2/2] quota: Fix deadlock with suspend and quotas Jan Kara
  -- strict thread matches above, loose matches on Subject: below --
2012-02-07 22:37 [PATCH 0/2] Fix deadlock with suspend & quotas Jan Kara
2012-02-07 22:37 ` [PATCH 1/2] vfs: Provide function to get superblock and wait for it to thaw Jan Kara
2012-02-08 23:20   ` Dave Chinner
2012-02-08 23:27     ` Jan Kara
2012-02-08 23:47       ` Jan Kara
2012-02-09 16:37         ` Eric Sandeen
2012-02-09 23:14           ` Mikulas Patocka
2012-02-10  9:48           ` Jan Kara
2012-02-10 23:16             ` Dave Chinner

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=20120212211325.GT23916@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=david@fromorbit.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=sandeen@sandeen.net \
    /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.