Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752110AbbHTKH5 (ORCPT ); Thu, 20 Aug 2015 06:07:57 -0400 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:54202 "EHLO e06smtp15.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751344AbbHTKHz (ORCPT ); Thu, 20 Aug 2015 06:07:55 -0400 X-Helo: d06dlp03.portsmouth.uk.ibm.com X-MailFrom: pmorel@linux.vnet.ibm.com X-RcptTo: linux-kernel@vger.kernel.org From: Pierre Morel To: linux-kernel@vger.kernel.org Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, farman@linux.vnet.ibm.com, cornelia.huck@de.ibm.com, pmorel@linux.vnet.ibm.com Subject: [PATCH] fs/block_dev.c: always return error in thaw_bdev() Date: Thu, 20 Aug 2015 12:07:49 +0200 Message-Id: <1440065269-10400-1-git-send-email-pmorel@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15082010-0021-0000-0000-00000503ECE4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1261 Lines: 41 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 --- 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); -- 2.3.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/