Mike Burns
2010-Mar-11 19:55 UTC
[Ovirt-devel] [PATCH node] Fix hang when cleaning dirty storage
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 | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index aea73f8..92d79dd 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -550,7 +550,7 @@ wipe_lvm_on_disk() unmount_logging for vg in $(pvs -o vg_name --noheadings $HOSTVGDRIVE* 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}p?[0-9]*" 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
Mike Burns
2010-Mar-17 17:23 UTC
[Ovirt-devel] [PATCH node] Fix hang when cleaning dirty storage
Patch has problems is there are a large number of devices. A re-worked patch should follow shortly. Mike On Thu, 2010-03-11 at 14:55 -0500, Mike Burns wrote:> 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 | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage > index aea73f8..92d79dd 100755 > --- a/scripts/ovirt-config-storage > +++ b/scripts/ovirt-config-storage > @@ -550,7 +550,7 @@ wipe_lvm_on_disk() > unmount_logging > for vg in $(pvs -o vg_name --noheadings $HOSTVGDRIVE* 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}p?[0-9]*" 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."
Mike Burns
2010-Mar-17 17:25 UTC
[Ovirt-devel] [PATCH node] Fix hang when cleaning dirty storage
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