linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Pierre Morel <pmorel@linux.vnet.ibm.com>
Cc: viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, mguzik@redhat.com,
	farman@linux.vnet.ibm.com, cornelia.huck@de.ibm.com,
	Jens Axboe <axboe@fb.com>
Subject: Re: [PATCH] fs/block_dev.c: return the right error in thaw_bdev()
Date: Tue, 4 Oct 2016 11:06:15 +0200	[thread overview]
Message-ID: <20161004090615.GF17515@quack2.suse.cz> (raw)
In-Reply-To: <1475571220-2522-2-git-send-email-pmorel@linux.vnet.ibm.com>

On Tue 04-10-16 10:53:40, 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>

The patch looks good. You can add:

Reviewed-by: Jan Kara <jack@suse.cz>

Jens, can you please merge this patch? Thanks!

								Honza

> ---
>  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 08ae993..0e7a8f4 100644
> --- a/fs/block_dev.c
> +++ b/fs/block_dev.c
> @@ -302,14 +302,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);
>  
> -- 
> 2.5.0
> 
> --
> 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.com>
SUSE Labs, CR

  reply	other threads:[~2016-10-04  9:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-04  8:53 [PATCH] return the right error in thaw_bdev() Pierre Morel
2016-10-04  8:53 ` [PATCH] fs/block_dev.c: " Pierre Morel
2016-10-04  9:06   ` Jan Kara [this message]
2016-10-05  6:47     ` Mateusz Guzik
2016-10-05  9:59       ` Jan Kara
2016-10-05 20:21         ` Dave Chinner
2016-10-05 20:35     ` Jens Axboe

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=20161004090615.GF17515@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=axboe@fb.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=mguzik@redhat.com \
    --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;
as well as URLs for NNTP newsgroup(s).