From patchwork Tue Mar 24 10:16:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 6077801 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0DB909F66C for ; Tue, 24 Mar 2015 10:16:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3C6262024D for ; Tue, 24 Mar 2015 10:16:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4B61E20218 for ; Tue, 24 Mar 2015 10:16:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752235AbbCXKQl (ORCPT ); Tue, 24 Mar 2015 06:16:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58637 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752165AbbCXKQa (ORCPT ); Tue, 24 Mar 2015 06:16:30 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2OAGRhS011817 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 24 Mar 2015 06:16:27 -0400 Received: from ad.nay.redhat.com (dhcp-14-137.nay.redhat.com [10.66.14.137]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2OAGJn6019132; Tue, 24 Mar 2015 06:16:24 -0400 From: Fam Zheng To: linux-kernel@vger.kernel.org Cc: Jens Axboe , "James E.J. Bottomley" , linux-scsi@vger.kernel.org, famz@redhat.com Subject: [PATCH 1/3] block: Return error in rescan_partitions if revalidating disk failed Date: Tue, 24 Mar 2015 18:16:13 +0800 Message-Id: <1427192175-23802-2-git-send-email-famz@redhat.com> In-Reply-To: <1427192175-23802-1-git-send-email-famz@redhat.com> References: <1427192175-23802-1-git-send-email-famz@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 If the disk can't read capacity, we should return an error. Signed-off-by: Fam Zheng --- block/partition-generic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/partition-generic.c b/block/partition-generic.c index 0d9e5f9..1e60d7d 100644 --- a/block/partition-generic.c +++ b/block/partition-generic.c @@ -427,11 +427,11 @@ rescan: return res; if (disk->fops->revalidate_disk) - disk->fops->revalidate_disk(disk); + res = disk->fops->revalidate_disk(disk); check_disk_size_change(disk, bdev); bdev->bd_invalidated = 0; - if (!get_capacity(disk) || !(state = check_partition(disk, bdev))) - return 0; + if (res || !get_capacity(disk) || !(state = check_partition(disk, bdev))) + return res; if (IS_ERR(state)) { /* * I/O error reading the partition table. If any