From 6d25082d659b8c671118a68a2e10f6c9eaac7f71 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Tue, 6 Apr 2010 17:36:41 +0000 Subject: [PATCH] Fix is_partitioned_dev not to attempt to reopen device. --- WHATS_NEW | 1 + lib/device/device.c | 11 +---------- test/test-utils.sh | 9 +++++++++ 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 75e3221e0..646cdbbfd 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.63 - ================================ + Fix is_partitioned_dev not to attempt to reopen device. Fix another thread race in clvmd. Refactor management of vg->pvs list. Fix lcov rules and generate better coverage report. diff --git a/lib/device/device.c b/lib/device/device.c index 72f3eab8d..7f9f40c27 100644 --- a/lib/device/device.c +++ b/lib/device/device.c @@ -62,13 +62,8 @@ static int _has_partition_table(struct device *dev) uint16_t *part_magic; struct partition *part; - if (!dev_open(dev)) { - stack; - return -1; - } - if (!dev_read(dev, UINT64_C(0), sizeof(buf), &buf)) - goto_out; + return_0; /* FIXME Check for other types of partition table too */ @@ -88,10 +83,6 @@ static int _has_partition_table(struct device *dev) } } - out: - if (!dev_close(dev)) - stack; - return ret; } diff --git a/test/test-utils.sh b/test/test-utils.sh index 5d8bb3aad..08e89c980 100644 --- a/test/test-utils.sh +++ b/test/test-utils.sh @@ -247,6 +247,15 @@ prepare_devs() { done finish_udev_transaction + for i in `seq 1 $n`; do + local name="${PREFIX}$pvname$i" + dmsetup info -c $name + done + for i in `seq 1 $n`; do + local name="${PREFIX}$pvname$i" + dmsetup table $name + done + # set up some default names vg=${PREFIX}vg vg1=${PREFIX}vg1