lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 4 Oct 2016 11:06:15 +0200
From:   Jan Kara <jack@...e.cz>
To:     Pierre Morel <pmorel@...ux.vnet.ibm.com>
Cc:     viro@...iv.linux.org.uk, linux-kernel@...r.kernel.org,
        linux-fsdevel@...r.kernel.org, mguzik@...hat.com,
        farman@...ux.vnet.ibm.com, cornelia.huck@...ibm.com,
        Jens Axboe <axboe@...com>
Subject: Re: [PATCH] fs/block_dev.c: return the right error in thaw_bdev()

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@...ux.vnet.ibm.com>
> Reviewed-by: Cornelia Huck <cornelia.huck@...ibm.com>
> Signed-off-by: Pierre Morel <pmorel@...ux.vnet.ibm.com>

The patch looks good. You can add:

Reviewed-by: Jan Kara <jack@...e.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@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ