1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-02-06 01:58:01 +03:00

Revert vg_read_internal change, clvmd cannot use vg_read now. (2.02.55)

This commit is contained in:
Milan Broz 2009-11-23 10:44:50 +00:00
parent 58a8b00086
commit def0f38f3d
4 changed files with 16 additions and 17 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.56 -
====================================
Revert vg_read_internal change, clvmd cannot use vg_read now. (2.02.55)
Version 2.02.55 - 19th November 2009
====================================

View File

@ -774,14 +774,15 @@ static void check_config()
void lvm_do_backup(const char *vgname)
{
struct volume_group * vg;
int consistent = 0;
DEBUGLOG("Triggering backup of VG metadata for %s. suspended=%d\n", vgname, suspended);
pthread_mutex_lock(&lvm_lock);
vg = vg_read(cmd, vgname, NULL /*vgid*/, 0 /*flags*/);
vg = vg_read_internal(cmd, vgname, NULL /*vgid*/, &consistent);
if (!vg_read_error(vg))
if (vg && consistent)
check_current_backup(vg);
else
log_error("Error backing up metadata, can't find VG for group %s", vgname);

View File

@ -380,6 +380,8 @@ void pvcreate_params_set_defaults(struct pvcreate_params *pp);
int vg_write(struct volume_group *vg);
int vg_commit(struct volume_group *vg);
int vg_revert(struct volume_group *vg);
struct volume_group *vg_read_internal(struct cmd_context *cmd, const char *vg_name,
const char *vgid, int *consistent);
struct physical_volume *pv_read(struct cmd_context *cmd, const char *pv_name,
struct dm_list *mdas, uint64_t *label_sector,
int warnings, int scan_label_only);
@ -470,7 +472,7 @@ int remove_lvs_in_vg(struct cmd_context *cmd,
force_t force);
/*
* vg_release() must be called on every struct volume_group allocated
* by vg_create() or vg_read() to free it when no longer required.
* by vg_create() or vg_read_internal() to free it when no longer required.
*/
void vg_release(struct volume_group *vg);

View File

@ -58,10 +58,6 @@ static struct physical_volume *_find_pv_in_vg_by_uuid(const struct volume_group
static uint32_t _vg_bad_status_bits(const struct volume_group *vg,
uint32_t status);
static struct volume_group *_vg_read_internal(struct cmd_context *cmd,
const char *vgname,
const char *vgid, int *consistent);
const char _really_init[] =
"Really INITIALIZE physical volume \"%s\" of volume group \"%s\" [y/n]? ";
@ -288,7 +284,7 @@ int get_pv_from_vg_by_id(const struct format_type *fmt, const char *vg_name,
struct pv_list *pvl;
int r = 0, consistent = 0;
if (!(vg = _vg_read_internal(fmt->cmd, vg_name, vgid, &consistent))) {
if (!(vg = vg_read_internal(fmt->cmd, vg_name, vgid, &consistent))) {
log_error("get_pv_from_vg_by_id: vg_read_internal failed to read VG %s",
vg_name);
return 0;
@ -790,10 +786,10 @@ struct volume_group *vg_create(struct cmd_context *cmd, const char *vg_name)
/* NOTE: let caller decide - this may be check for existence */
return _vg_make_handle(cmd, NULL, rc);
/* FIXME: Is this _vg_read_internal necessary? Move it inside
/* FIXME: Is this vg_read_internal necessary? Move it inside
vg_lock_newname? */
/* is this vg name already in use ? */
if ((vg = _vg_read_internal(cmd, vg_name, NULL, &consistent))) {
if ((vg = vg_read_internal(cmd, vg_name, NULL, &consistent))) {
log_error("A volume group called '%s' already exists.", vg_name);
unlock_and_release_vg(cmd, vg, vg_name);
return _vg_make_handle(cmd, NULL, FAILED_EXIST);
@ -2494,7 +2490,7 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
if (is_orphan_vg(vgname)) {
if (use_precommitted) {
log_error("Internal error: _vg_read requires vgname "
log_error("Internal error: vg_read_internal requires vgname "
"with pre-commit.");
return NULL;
}
@ -2783,9 +2779,8 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
return correct_vg;
}
static struct volume_group *_vg_read_internal(struct cmd_context *cmd,
const char *vgname,
const char *vgid, int *consistent)
struct volume_group *vg_read_internal(struct cmd_context *cmd, const char *vgname,
const char *vgid, int *consistent)
{
struct volume_group *vg;
struct lv_list *lvl;
@ -3050,7 +3045,7 @@ static int _get_pvs(struct cmd_context *cmd, struct dm_list **pvslist)
stack;
continue;
}
if (!(vg = _vg_read_internal(cmd, vgname, vgid, &consistent))) {
if (!(vg = vg_read_internal(cmd, vgname, vgid, &consistent))) {
stack;
continue;
}
@ -3284,7 +3279,7 @@ static struct volume_group *_recover_vg(struct cmd_context *cmd, const char *loc
if (!lock_vol(cmd, lock_name, lock_flags))
return_NULL;
if (!(vg = _vg_read_internal(cmd, vg_name, vgid, &consistent)))
if (!(vg = vg_read_internal(cmd, vg_name, vgid, &consistent)))
return_NULL;
if (!consistent) {
@ -3341,7 +3336,7 @@ static struct volume_group *_vg_lock_and_read(struct cmd_context *cmd, const cha
consistent_in = consistent;
/* If consistent == 1, we get NULL here if correction fails. */
if (!(vg = _vg_read_internal(cmd, vg_name, vgid, &consistent))) {
if (!(vg = vg_read_internal(cmd, vg_name, vgid, &consistent))) {
if (consistent_in && !consistent) {
log_error("Volume group \"%s\" inconsistent.", vg_name);
failure |= FAILED_INCONSISTENT;