From: Jan Kara <jack@suse.cz>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Jan Kara <jack@suse.cz>, 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: Mon, 13 Feb 2012 15:24:18 +0100 [thread overview]
Message-ID: <20120213142418.GA6478@quack.suse.cz> (raw)
In-Reply-To: <20120212211325.GT23916@ZenIV.linux.org.uk>
On Sun 12-02-12 21:13:25, Al Viro wrote:
> 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.
Yeah, this looks better. Thanks!
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
next prev parent reply other threads:[~2012-02-13 14:24 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
2012-02-13 14:24 ` Jan Kara [this message]
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=20120213142418.GA6478@quack.suse.cz \
--to=jack@suse.cz \
--cc=david@fromorbit.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpatocka@redhat.com \
--cc=sandeen@sandeen.net \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).