From patchwork Mon Jul 20 19:35:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick X-Patchwork-Id: 6830351 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1B8D4C05AC for ; Mon, 20 Jul 2015 19:40:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 576612055A for ; Mon, 20 Jul 2015 19:40:22 +0000 (UTC) Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 678EC20584 for ; Mon, 20 Jul 2015 19:40:21 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id t6KJZtGw018615; Mon, 20 Jul 2015 15:35:56 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id t6KJZr46006134 for ; Mon, 20 Jul 2015 15:35:53 -0400 Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t6KJZrVe025581 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 20 Jul 2015 15:35:53 -0400 Received: from mail-ie0-f171.google.com (mail-ie0-f171.google.com [209.85.223.171]) by mx1.redhat.com (Postfix) with ESMTPS id C4A492B64A2; Mon, 20 Jul 2015 19:35:52 +0000 (UTC) Received: by ietj16 with SMTP id j16so125362607iet.0; Mon, 20 Jul 2015 12:35:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=V3cSUcgFrAmX92rsV+EnnjIRxcHjtDdiEnbovR1gZP0=; b=E4LPk6h8+IbgSfK+fABSHzTGanJIkhERJxTv9k8nxt8FJkN+1V5am5rz38LKAN2mzs xA/SosK8nU7T8FrzEzOwXBidj0nGKGFVYY9FEgjLLTyFyev6KZrlANvYDlpum+LwquQk EeYqzTvjLtT0HWtH4uSAvkpM7ylFQ484jTFfjlj9BsLeJgh/wQlAsCvRn9R7cso1J6ED BV59s/bxuMAz6rMhmMhQ35vlp21LOrMRg616f1icV1W2HjLW684+gUFZIAFZWDD7MEo8 NNqH/2uGwHyEoJDr2OQ/90tuJdUGnIh+p38j72lFRf23DWV9h/QRm6uHRc4PutJgISll N0aA== X-Received: by 10.107.46.162 with SMTP id u34mr40106864iou.124.1437420952121; Mon, 20 Jul 2015 12:35:52 -0700 (PDT) Received: from nick-System-Product-Name.hitronhub.home (CPEbc4dfb2691f3-CMbc4dfb2691f0.cpe.net.cable.rogers.com. [99.231.110.121]) by smtp.googlemail.com with ESMTPSA id v82sm14296904ioi.11.2015.07.20.12.35.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 Jul 2015 12:35:51 -0700 (PDT) From: Nicholas Krause To: agk@redhat.com Date: Mon, 20 Jul 2015 15:35:48 -0400 Message-Id: <1437420948-26201-1-git-send-email-xerofoify@gmail.com> X-RedHat-Spam-Score: -2.801 (BAYES_00, DCC_REPUT_13_19, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.223.171 mail-ie0-f171.google.com 209.85.223.171 mail-ie0-f171.google.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Scanned-By: MIMEDefang 2.75 on 10.5.110.28 X-loop: dm-devel@redhat.com Cc: linux-raid@vger.kernel.org, dm-devel@redhat.com, neilb@suse.com, snitzer@redhat.com, linux-kernel@vger.kernel.org Subject: [dm-devel] [PATCH] md:Check if call to thaw_bdev fails in unlock_fs X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This adds a check to the function unlock_fs to check if the call to thaw_bdev failed by returning a return code and if so print on the log level of KERN_CRIT that the thaw has failed on the passed device structure pointer's name before returnin immediately to this function's caller. Signed-off-by: Nicholas Krause --- drivers/md/dm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index ab37ae1..20ccc36 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -3152,7 +3152,11 @@ static void unlock_fs(struct mapped_device *md) if (!test_bit(DMF_FROZEN, &md->flags)) return; - thaw_bdev(md->bdev, md->frozen_sb); + if (!thaw_bdev(md->bdev, md->frozen_sb)) { + pr_crit("Thaw failed on the file device %s\n", md->name); + return; + } + md->frozen_sb = NULL; clear_bit(DMF_FROZEN, &md->flags); }