mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Fix a segfault if using pvs with --all argument. (2.02.29)
This commit is contained in:
parent
48d9a74d16
commit
a95892f77d
@ -1,5 +1,6 @@
|
||||
Version 2.02.30 -
|
||||
===================================
|
||||
Fix a segfault if using pvs with --all argument. (2.02.29)
|
||||
Update --uuid argument description in man pages.
|
||||
Fix vgreduce PV list processing not to process every PV in the VG. (2.02.29)
|
||||
Extend lvconvert to use polldaemon.
|
||||
|
@ -312,6 +312,7 @@ struct list *get_vgids(struct cmd_context *cmd, int full_scan);
|
||||
|
||||
int pv_write(struct cmd_context *cmd, struct physical_volume *pv,
|
||||
struct list *mdas, int64_t label_sector);
|
||||
int is_pv(pv_t *pv);
|
||||
int is_orphan_vg(const char *vg_name);
|
||||
int is_orphan(pv_t *pv);
|
||||
vg_t *vg_lock_and_read(struct cmd_context *cmd, const char *vg_name,
|
||||
|
@ -1832,6 +1832,15 @@ int is_orphan(pv_t *pv)
|
||||
return is_orphan_vg(pv_field(pv, vg_name));
|
||||
}
|
||||
|
||||
/**
|
||||
* is_pv - Determine whether a pv is a real pv or dummy one
|
||||
* @pv: handle to device
|
||||
*/
|
||||
int is_pv(pv_t *pv)
|
||||
{
|
||||
return (pv_field(pv, vg_name) ? 1 : 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns:
|
||||
* 0 - fail
|
||||
|
@ -91,7 +91,7 @@ static int _pvs_single(struct cmd_context *cmd, struct volume_group *vg,
|
||||
int ret = ECMD_PROCESSED;
|
||||
const char *vg_name = NULL;
|
||||
|
||||
if (!is_orphan(pv) && !vg) {
|
||||
if (is_pv(pv) && !is_orphan(pv) && !vg) {
|
||||
vg_name = pv_vg_name(pv);
|
||||
|
||||
if (!(vg = vg_lock_and_read(cmd, vg_name, (char *)&pv->vgid,
|
||||
|
Loading…
Reference in New Issue
Block a user