From: Jan Kara <jack@suse.cz>
To: "Fernando Luis Vázquez Cao" <fernando_b1@lab.ntt.co.jp>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
Dave Chinner <dchinner@redhat.com>,
Christoph Hellwig <hch@infradead.org>,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/7] fsfreeze: Prevent emergency thaw from looping infinitely
Date: Tue, 10 Jul 2012 14:08:58 +0200 [thread overview]
Message-ID: <20120710120858.GD13539@quack.suse.cz> (raw)
In-Reply-To: <1341908457.11559.9.camel@nexus.lab.ntt.co.jp>
On Tue 10-07-12 17:20:57, Fernando Luis Vázquez Cao wrote:
> The thawing of a filesystem through sysrq-j loops infinitely as it
> incorrectly detects a thawed filesytsem as frozen and tries to
> unfreeze repeatedly. This is a regression caused by
> 4504230a71566785a05d3e6b53fa1ee071b864eb ("freeze_bdev: grab active
> reference to frozen superblocks") in that it no longer returned
> -EINVAL for superblocks that were not frozen.
Umm, I don't think above mentioned commit is really guilty. Also I think
your patch breaks thawing of a block device without mounted filesystem -
you end up returning EINVAL for that...
Honza
>
> Return -EINVAL when the filesystem is already unfrozen to avoid this
> problem.
>
> Cc: Christoph Hellwig <hch@infradead.org>
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
> ---
>
> diff -urNp linux-3.5-rc4-orig/fs/block_dev.c linux-3.5-rc4/fs/block_dev.c
> --- linux-3.5-rc4-orig/fs/block_dev.c 2012-06-27 12:00:47.694616000 +0900
> +++ linux-3.5-rc4/fs/block_dev.c 2012-06-29 13:38:23.841352532 +0900
> @@ -319,22 +319,20 @@ int thaw_bdev(struct block_device *bdev,
> if (!bdev->bd_fsfreeze_count)
> goto out;
>
> - error = 0;
> - if (--bdev->bd_fsfreeze_count > 0)
> + if (--bdev->bd_fsfreeze_count > 0) {
> + error = 0;
> goto out;
> + }
>
> if (!sb)
> goto out;
>
> error = thaw_super(sb);
> - if (error) {
> + if (error)
> bdev->bd_fsfreeze_count++;
> - mutex_unlock(&bdev->bd_fsfreeze_mutex);
> - return error;
> - }
> out:
> mutex_unlock(&bdev->bd_fsfreeze_mutex);
> - return 0;
> + return error;
> }
> EXPORT_SYMBOL(thaw_bdev);
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2012-07-10 12:09 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-10 8:16 [RFC, PATCH 0/7] fsfreeze: miscellaneous fixes and cleanups Fernando Luis Vázquez Cao
2012-07-10 8:20 ` [PATCH 1/7] fsfreeze: Prevent emergency thaw from looping infinitely Fernando Luis Vázquez Cao
2012-07-10 12:08 ` Jan Kara [this message]
2012-07-11 2:25 ` Fernando Luis Vazquez Cao
2012-07-11 9:02 ` Jan Kara
2012-07-12 1:49 ` Fernando Luis Vazquez Cao
2012-07-10 8:23 ` [PATCH 2/7] fsfreeze: emergency thaw will deadlock on s_umount Fernando Luis Vázquez Cao
2012-07-10 9:09 ` Jan Kara
2012-07-10 9:13 ` Jan Kara
2012-07-10 9:30 ` Fernando Luis Vazquez Cao
2012-07-10 12:15 ` Jan Kara
2012-07-11 2:38 ` Fernando Luis Vazquez Cao
2012-07-11 9:06 ` Jan Kara
2012-07-12 2:08 ` Fernando Luis Vazquez Cao
2012-07-10 8:25 ` [PATCH 3/7] fsfreeze: freeze_super and thaw_bdev don't play well together Fernando Luis Vázquez Cao
2012-07-10 8:30 ` [PATCH 4/7] fsfreeze: switch to using super methods where possible Fernando Luis Vázquez Cao
2012-07-10 8:32 ` [PATCH 5/7] fsfreeze: move emergency thaw code to fs/super.c Fernando Luis Vázquez Cao
2012-07-10 8:34 ` [PATCH 6/7] fsfreeze: add vfs ioctl to check freeze state Fernando Luis Vázquez Cao
2012-07-10 8:35 ` [PATCH 7/7] fsfreeze: add block device " Fernando Luis Vázquez Cao
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=20120710120858.GD13539@quack.suse.cz \
--to=jack@suse.cz \
--cc=dchinner@redhat.com \
--cc=fernando_b1@lab.ntt.co.jp \
--cc=hch@infradead.org \
--cc=linux-fsdevel@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 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).