lkml.org 
[lkml]   [2015]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/3] block: Return error in rescan_partitions if revalidating disk failed
Date
If the disk can't read capacity, we should return an error.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
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
--
1.9.3


\
 
 \ /
  Last update: 2015-03-24 11:41    [W:0.059 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site