linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fernando Luis Vazquez Cao <fernando_b1@lab.ntt.co.jp>
To: Jan Kara <jack@suse.cz>
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: Wed, 11 Jul 2012 11:25:56 +0900	[thread overview]
Message-ID: <4FFCE434.601@lab.ntt.co.jp> (raw)
In-Reply-To: <20120710120858.GD13539@quack.suse.cz>

On 2012/07/10 21:08, Jan Kara wrote:

> 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.

Well, it is after that commit that

-       if (!bdev->bd_fsfreeze_count) {
-               mutex_unlock(&bdev->bd_fsfreeze_mutex);
-               return -EINVAL;
-       }

became

+       if (!bdev->bd_fsfreeze_count)
+               goto out_unlock;
[...]
+out_unlock:
         mutex_unlock(&bdev->bd_fsfreeze_mutex);
         return 0;

which breaks emergency thaw.


> Also I think your patch breaks thawing of a block device without mounted
> filesystem - you end up returning EINVAL for that...

It returns EINVAL only after the last thaw and the block device
is still properly thawed (i.e. bd_fsfreeze_count becomes 0). Things
work because the only place where the kernel checks the return
value of thaw_bdev is emergency thaw (the freeze ioctls use the sb
level API). That said for the sake of readability I could change the
code to return 0 when sb == NULL (either as a follow-up patch
or as part of a rebase to your tree or Al's).

Thanks,
Fernando
--
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

  reply	other threads:[~2012-07-11  2:27 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
2012-07-11  2:25     ` Fernando Luis Vazquez Cao [this message]
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=4FFCE434.601@lab.ntt.co.jp \
    --to=fernando_b1@lab.ntt.co.jp \
    --cc=dchinner@redhat.com \
    --cc=hch@infradead.org \
    --cc=jack@suse.cz \
    --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).