Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1494692 > unrolled thread

Re: [PATCH] fs/block_dev.c: always return error in thaw_bdev()

Started byMateusz Guzik <mguzik@redhat.com>
First post2016-10-03 06:20 +0200
Last post2016-10-03 06:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] fs/block_dev.c: always return error in thaw_bdev() Mateusz Guzik <mguzik@redhat.com> - 2016-10-03 06:20 +0200

#1494692 — Re: [PATCH] fs/block_dev.c: always return error in thaw_bdev()

FromMateusz Guzik <mguzik@redhat.com>
Date2016-10-03 06:20 +0200
SubjectRe: [PATCH] fs/block_dev.c: always return error in thaw_bdev()
Message-ID<so2Tn-7Gd-3@gated-at.bofh.it>
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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web