Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752266AbcJDJGZ (ORCPT ); Tue, 4 Oct 2016 05:06:25 -0400 Received: from mx2.suse.de ([195.135.220.15]:50642 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751520AbcJDJGX (ORCPT ); Tue, 4 Oct 2016 05:06:23 -0400 Date: Tue, 4 Oct 2016 11:06:15 +0200 From: Jan Kara To: Pierre Morel 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 Subject: Re: [PATCH] fs/block_dev.c: return the right error in thaw_bdev() Message-ID: <20161004090615.GF17515@quack2.suse.cz> References: <1475571220-2522-1-git-send-email-pmorel@linux.vnet.ibm.com> <1475571220-2522-2-git-send-email-pmorel@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1475571220-2522-2-git-send-email-pmorel@linux.vnet.ibm.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1520 Lines: 53 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 > Reviewed-by: Cornelia Huck > Signed-off-by: Pierre Morel The patch looks good. You can add: Reviewed-by: Jan Kara 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 SUSE Labs, CR