summaryrefslogtreecommitdiffstats
path: root/tools/vgreduce.c
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2012-06-21 12:43:31 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2012-08-23 14:37:52 +0200
commitfd417db274e9a75f33f661b475aeebfd3d9eae45 (patch)
tree0a141abbc4fca181dd8ebd93859a7723caceee0f /tools/vgreduce.c
parent15891d366d34fa6ea7235ec803ee0c5445a17101 (diff)
downloadlvm2-fd417db274e9a75f33f661b475aeebfd3d9eae45.tar.gz
lvm2-fd417db274e9a75f33f661b475aeebfd3d9eae45.tar.xz
lvm2-fd417db274e9a75f33f661b475aeebfd3d9eae45.zip
check: add internal errors for unexpected paths
Adding couple INTERNAL_ERROR reports for unwanted parameters: Ensure the 'top' metadata node cannot be NULL for lvmetad. Make obvious vginfo2 cannot be NULL. Report internal error if handler and vg is undefined. Check for handle in poll_vg(). Ensure seg is not NULL in dev_manager_transient(). Report missing read_ahead for _lv_read_ahead_single(). Check for report handler in dm_report_object(). Check missing VG in _vgreduce_single().
Diffstat (limited to 'tools/vgreduce.c')
-rw-r--r--tools/vgreduce.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/vgreduce.c b/tools/vgreduce.c
index 96966513..975b9eab 100644
--- a/tools/vgreduce.c
+++ b/tools/vgreduce.c
@@ -124,6 +124,11 @@ static int _vgreduce_single(struct cmd_context *cmd, struct volume_group *vg,
int r = ECMD_FAILED;
const char *name = pv_dev_name(pv);
+ if (!vg) {
+ log_error(INTERNAL_ERROR "VG is NULL.");
+ return ECMD_FAILED;
+ }
+
if (pv_pe_alloc_count(pv)) {
log_error("Physical volume \"%s\" still in use", name);
return ECMD_FAILED;