[Ovirt-devel] [PATCH node] Fix hang when cleaning dirty storage
Mike Burns
mburns at redhat.com
Wed Mar 17 17:25:13 UTC 2010
Code that scanned for dirty storage was accidentally grepping the
contents of an entire partition. This led to an apparent hang in
situations where partitions were large.
Signed-off-by: Mike Burns <mburns at redhat.com>
---
scripts/ovirt-config-storage | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage
index aea73f8..1e81db0 100755
--- a/scripts/ovirt-config-storage
+++ b/scripts/ovirt-config-storage
@@ -548,9 +548,13 @@ wipe_lvm_on_disk()
{
local dev=${1-$HOSTVGDRIVE}
unmount_logging
- for vg in $(pvs -o vg_name --noheadings $HOSTVGDRIVE* 2>/dev/null|sort -u); do
+ local part_delim="p"
+ if [[ "$dev" =~ "/dev/sd" ]]; then
+ part_delim=""
+ fi
+ for vg in $(pvs -o vg_name --noheadings $HOSTVGDRIVE $HOSTVGDRIVE${dev_delim}[0-9]* 2>/dev/null|sort -u); do
if pvs -o pv_name,vg_name --noheadings | \
- grep $vg | grep -v -q $dev* 2>/dev/null; then
+ grep $vg | egrep -v -q "${dev}${part_delim}[0-9]+|${dev}" 2>/dev/null; then
log "The volume group \"$vg\" spans multiple disks."
log "This operation cannot complete. Please manullay"
log "cleanup the storage using standard linux tools."
--
1.6.6.1
More information about the ovirt-devel
mailing list