1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

Fix a segfault if using pvs with --all argument. (2.02.29)

This commit is contained in:
Milan Broz 2008-01-07 20:42:57 +00:00
parent 48d9a74d16
commit a95892f77d
4 changed files with 12 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.30 - Version 2.02.30 -
=================================== ===================================
Fix a segfault if using pvs with --all argument. (2.02.29)
Update --uuid argument description in man pages. Update --uuid argument description in man pages.
Fix vgreduce PV list processing not to process every PV in the VG. (2.02.29) Fix vgreduce PV list processing not to process every PV in the VG. (2.02.29)
Extend lvconvert to use polldaemon. Extend lvconvert to use polldaemon.

View File

@ -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, int pv_write(struct cmd_context *cmd, struct physical_volume *pv,
struct list *mdas, int64_t label_sector); struct list *mdas, int64_t label_sector);
int is_pv(pv_t *pv);
int is_orphan_vg(const char *vg_name); int is_orphan_vg(const char *vg_name);
int is_orphan(pv_t *pv); int is_orphan(pv_t *pv);
vg_t *vg_lock_and_read(struct cmd_context *cmd, const char *vg_name, vg_t *vg_lock_and_read(struct cmd_context *cmd, const char *vg_name,

View File

@ -1832,6 +1832,15 @@ int is_orphan(pv_t *pv)
return is_orphan_vg(pv_field(pv, vg_name)); 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: * Returns:
* 0 - fail * 0 - fail

View File

@ -91,7 +91,7 @@ static int _pvs_single(struct cmd_context *cmd, struct volume_group *vg,
int ret = ECMD_PROCESSED; int ret = ECMD_PROCESSED;
const char *vg_name = NULL; const char *vg_name = NULL;
if (!is_orphan(pv) && !vg) { if (is_pv(pv) && !is_orphan(pv) && !vg) {
vg_name = pv_vg_name(pv); vg_name = pv_vg_name(pv);
if (!(vg = vg_lock_and_read(cmd, vg_name, (char *)&pv->vgid, if (!(vg = vg_lock_and_read(cmd, vg_name, (char *)&pv->vgid,