From: Al Viro <viro@ZenIV.linux.org.uk>
To: Josef Bacik <josef@redhat.com>
Cc: 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: Tue, 23 Mar 2010 14:28:44 +0000 [thread overview]
Message-ID: <20100323142843.GG30031@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20100323142200.GA2381@localhost.localdomain>
On Tue, Mar 23, 2010 at 10:22:00AM -0400, Josef Bacik wrote:
> Currently the way we do freezing is by passing sb>s_bdev to freeze_bdev and then
> letting it do all the work. But freezing is more of an fs thing, and doesn't
> really have much to do with the bdev at all, all the work gets done with the
> super. In btrfs we do not populate s_bdev, since we can have multiple bdev's
> for one fs and setting s_bdev makes removing devices from a pool kind of tricky.
> This means that freezing a btrfs filesystem fails, which causes us to corrupt
> with things like tux-on-ice which use the fsfreeze mechanism. So instead of
> populating sb->s_bdev with a random bdev in our pool, I've broken the actual fs
> freezing stuff into freeze_super and thaw_super. These just take the
> super_block that we're freezing and does the appropriate work. It's basically
> just copy and pasted from freeze_bdev. I've then converted freeze_bdev over to
> use the new super helpers. I've tested this with ext4 and btrfs and verified
> everything continues to work the same as before.
>
> The only new gotcha is multiple calls to the fsfreeze ioctl will return EBUSY if
> the fs is already frozen. I thought this was a better solution than adding a
> freeze counter to the super_block, but if everybody hates this idea I'm open to
> suggestions. Thanks,
Locking is all wrong there. We don't need to worry about umount; we *already*
have an active reference. And leaving a kernel object with semaphore held
when ioctl returns is completely wrong.
next prev parent reply other threads:[~2010-03-23 14:28 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 [this message]
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
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=20100323142843.GG30031@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--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 \
/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).