lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1427192175-23802-2-git-send-email-famz@redhat.com>
Date:	Tue, 24 Mar 2015 18:16:13 +0800
From:	Fam Zheng <famz@...hat.com>
To:	linux-kernel@...r.kernel.org
Cc:	Jens Axboe <axboe@...nel.dk>,
	"James E.J. Bottomley" <JBottomley@...allels.com>,
	linux-scsi@...r.kernel.org, famz@...hat.com
Subject: [PATCH 1/3] block: Return error in rescan_partitions if revalidating disk failed

If the disk can't read capacity, we should return an error.

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ