From: Mateusz Guzik <mguzik@redhat.com>
To: Pierre Morel <pmorel@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk,
linux-fsdevel@vger.kernel.org, farman@linux.vnet.ibm.com,
cornelia.huck@de.ibm.com
Subject: Re: [PATCH] fs/block_dev.c: always return error in thaw_bdev()
Date: Mon, 3 Oct 2016 06:13:47 +0200 [thread overview]
Message-ID: <20161003041346.4lvxz4ue3qfhyfpm@mguzik> (raw)
In-Reply-To: <1440065269-10400-1-git-send-email-pmorel@linux.vnet.ibm.com>
On Thu, Aug 20, 2015 at 12:07:49PM +0200, Pierre Morel wrote:
> When triggering thaw-filesystems via magic sysrq, the system enters a
> loop in do_thaw_one(), as thaw_bdev() still returns success if
> bd_fsfreeze_count == 0. To fix this, let thaw_bdev() always return
> error (and simplify the code a bit at the same time).
>
> Reviewed-by: Eric Farman <farman@linux.vnet.ibm.com>
> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
> Signed-off-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
> ---
> fs/block_dev.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/fs/block_dev.c b/fs/block_dev.c
> index c7e4163..7809c92 100644
> --- a/fs/block_dev.c
> +++ b/fs/block_dev.c
> @@ -269,14 +269,11 @@ int thaw_bdev(struct block_device *bdev, struct super_block *sb)
> error = sb->s_op->thaw_super(sb);
> else
> 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);
>
Apparently this never got in.
The bug is still there, reproducible with mere:
echo j > /proc/sysrq-trigger
--
Mateusz Guzik
prev parent reply other threads:[~2016-10-03 4:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-20 10:07 Pierre Morel
2016-10-03 4:13 ` Mateusz Guzik [this message]
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=20161003041346.4lvxz4ue3qfhyfpm@mguzik \
--to=mguzik@redhat.com \
--cc=cornelia.huck@de.ibm.com \
--cc=farman@linux.vnet.ibm.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmorel@linux.vnet.ibm.com \
--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
all inboxes | Powered by JetHome®