master - version: update
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=99d1e264a87eb2...
Commit: 99d1e264a87eb256debe2eaa02d9fc4e2b08c815
Parent: 329c46d36ee16cc374c31af7aaf3bb84b21ab462
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Fri Aug 24 18:51:24 2012 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Fri Aug 24 18:51:24 2012 +0100
version: update
---
VERSION | 2 +-
VERSION_DM | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/VERSION b/VERSION
index 159419f..33b5cee 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.97(2)-git (2012-08-07)
+2.02.98(2)-git (2012-08-24)
diff --git a/VERSION_DM b/VERSION_DM
index 6b6b104..171ac28 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.76-git (2012-08-07)
+1.02.77-git (2012-08-24)
11 years, 8 months
master - clenaup: compatible definition for older gcc
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=329c46d36ee16c...
Commit: 329c46d36ee16cc374c31af7aaf3bb84b21ab462
Parent: 7b300a803c0878e6c9a42aeb5d2c53ac7f64afed
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Aug 23 16:12:45 2012 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Aug 23 16:30:22 2012 +0200
clenaup: compatible definition for older gcc
Fixes previous commit, it seems older gcc compilers do not
recognize same typedef.
(Easiest would be probably to directly include proper header here).
---
lib/cache/lvmetad.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/cache/lvmetad.h b/lib/cache/lvmetad.h
index 932a9f1..9c49440 100644
--- a/lib/cache/lvmetad.h
+++ b/lib/cache/lvmetad.h
@@ -18,10 +18,10 @@
struct volume_group;
struct cmd_context;
struct dm_config_tree;
-typedef enum activation_change activation_change_t;
+enum activation_change;
typedef int (*activation_handler) (struct volume_group *vg, int partial,
- activation_change_t activate);
+ enum activation_change activate);
#ifdef LVMETAD_SUPPORT
/*
11 years, 8 months
master - cleanup: add some missing stack backtraces
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7b300a803c0878...
Commit: 7b300a803c0878e6c9a42aeb5d2c53ac7f64afed
Parent: 109b3bb49b31d5fa7f6d0dd23345d703ab866ad6
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Mar 13 21:36:02 2012 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Aug 23 14:38:48 2012 +0200
cleanup: add some missing stack backtraces
---
lib/metadata/metadata.c | 21 ++++++++++++---------
1 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index fd13b0a..205f77e 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -645,19 +645,19 @@ static int vg_extend_single_pv(struct volume_group *vg, char *pv_name,
{
struct physical_volume *pv;
- pv = pv_by_path(vg->fid->fmt->cmd, pv_name);
+ if (!(pv = pv_by_path(vg->fid->fmt->cmd, pv_name)))
+ stack;
if (!pv && !pp) {
log_error("%s not identified as an existing "
"physical volume", pv_name);
return 0;
} else if (!pv && pp) {
- pv = pvcreate_single(vg->cmd, pv_name, pp, 0);
- if (!pv)
- return 0;
+ if (!(pv = pvcreate_single(vg->cmd, pv_name, pp, 0)))
+ return_0;
}
if (!add_pv_to_vg(vg, pv_name, pv, pp)) {
free_pv_fid(pv);
- return 0;
+ return_0;
}
return 1;
}
@@ -679,7 +679,7 @@ int vg_extend(struct volume_group *vg, int pv_count, const char *const *pv_names
char *pv_name;
if (_vg_bad_status_bits(vg, RESIZEABLE_VG))
- return 0;
+ return_0;
/* attach each pv */
for (i = 0; i < pv_count; i++) {
@@ -1327,7 +1327,8 @@ static int pvcreate_check(struct cmd_context *cmd, const char *name,
/* FIXME Check partition type is LVM unless --force is given */
/* Is there a pv here already? */
- pv = pv_read(cmd, name, 0, 0);
+ if (!(pv = pv_read(cmd, name, 0, 0)))
+ stack;
/*
* If a PV has no MDAs it may appear to be an orphan until the
@@ -1339,7 +1340,8 @@ static int pvcreate_check(struct cmd_context *cmd, const char *name,
free_pv_fid(pv);
if (!scan_vgs_for_pvs(cmd, 0))
return_0;
- pv = pv_read(cmd, name, 0, 0);
+ if (!(pv = pv_read(cmd, name, 0, 0)))
+ stack;
}
/* Allow partial & exported VGs to be destroyed. */
@@ -1513,7 +1515,7 @@ struct physical_volume * pvcreate_single(struct cmd_context *cmd,
goto_bad;
log_error("uuid %s already in use on \"%s\"", buffer,
dev_name(dev));
- goto bad;;
+ goto bad;
}
}
@@ -2766,6 +2768,7 @@ static int _vg_read_orphan_pv(struct lvmcache_info *info, void *baton)
if (!(pv = _pv_read(b->vg->cmd, b->vg->vgmem, dev_name(lvmcache_device(info)),
b->vg->fid, b->warnings, 0))) {
+ stack;
return 1;
}
11 years, 8 months
master - thin: discard
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=109b3bb49b31d5...
Commit: 109b3bb49b31d5fa7f6d0dd23345d703ab866ad6
Parent: 0de57b98bf0778684e8fac6d2d66ecf3fbc035ab
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Aug 21 15:51:54 2012 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Aug 23 14:38:48 2012 +0200
thin: discard
---
tools/lvchange.c | 2 +-
tools/lvcreate.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/lvchange.c b/tools/lvchange.c
index a0c4a01..73a37fd 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -103,7 +103,7 @@ static int lvchange_pool_update(struct cmd_context *cmd,
}
if (arg_count(cmd, discards_ARG)) {
- discards = arg_uint_value(cmd, discards_ARG, 0);
+ discards = (thin_discards_t) arg_uint_value(cmd, discards_ARG, THIN_DISCARDS_IGNORE);
if (discards != first_seg(lv)->discards) {
if (((discards == THIN_DISCARDS_IGNORE) ||
(first_seg(lv)->discards == THIN_DISCARDS_IGNORE)) &&
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index 769ac8c..2cb6ac0 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
- * Copyright (C) 2004-2011 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004-2012 Red Hat, Inc. All rights reserved.
*
* This file is part of LVM2.
*
@@ -797,7 +797,7 @@ static int _lvcreate_params(struct lvcreate_params *lp,
return_0;
if (lp->create_thin_pool) {
- lp->discards = arg_uint_value(cmd, discards_ARG, THIN_DISCARDS_PASSDOWN);
+ lp->discards = (thin_discards_t) arg_uint_value(cmd, discards_ARG, THIN_DISCARDS_PASSDOWN);
} else if (arg_count(cmd, discards_ARG)) {
log_error("--discards is only available for thin pool creation.");
return 0;
11 years, 8 months
master - lvmapi: validate extents size for lvcreate
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0de57b98bf0778...
Commit: 0de57b98bf0778684e8fac6d2d66ecf3fbc035ab
Parent: eb08f8652125513761e83c324a2c7e706ccda791
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Mar 1 17:59:35 2012 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Aug 23 14:38:48 2012 +0200
lvmapi: validate extents size for lvcreate
---
liblvm/lvm_lv.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/liblvm/lvm_lv.c b/liblvm/lvm_lv.c
index 23ccbe8..2d4dc02 100644
--- a/liblvm/lvm_lv.c
+++ b/liblvm/lvm_lv.c
@@ -153,15 +153,18 @@ lv_t lvm_vg_create_lv_linear(vg_t vg, const char *name, uint64_t size)
if (!vg_check_write_mode(vg))
return NULL;
- extents = extents_from_size(vg->cmd, size / SECTOR_SIZE,
- vg->extent_size);
+ if (!(extents = extents_from_size(vg->cmd, size / SECTOR_SIZE,
+ vg->extent_size))) {
+ log_error("Unable to create LV without size.");
+ return NULL;
+ }
+
_lv_set_default_params(&lp, vg, name, extents);
if (!_lv_set_default_linear_params(vg->cmd, &lp))
return_NULL;
if (!lv_create_single(vg, &lp))
- return NULL;
- lvl = find_lv_in_vg(vg, name);
- if (!lvl)
+ return_NULL;
+ if (!(lvl = find_lv_in_vg(vg, name)))
return NULL;
return (lv_t) lvl->lv;
}
11 years, 8 months
master - cleanup: initilize percent to INVALID
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=eb08f865212551...
Commit: eb08f8652125513761e83c324a2c7e706ccda791
Parent: c6f680ee4945f22670d133ba341bb670c1d0a474
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jun 20 12:05:00 2012 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Aug 23 14:38:48 2012 +0200
cleanup: initilize percent to INVALID
Always initialize percent to INVALID value, in case target
would have forget to setup this value somehow.
---
lib/activate/dev_manager.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 43bcd49..c8a1e35 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -514,11 +514,11 @@ static int _percent_run(struct dev_manager *dm, const char *name,
struct lv_segment *seg = NULL;
struct segment_type *segtype;
int first_time = 1;
- percent_t percent;
+ percent_t percent = PERCENT_INVALID;
uint64_t total_numerator = 0, total_denominator = 0;
- *overall_percent = PERCENT_INVALID;
+ *overall_percent = percent;
if (!(dmt = _setup_task(name, dlid, event_nr,
wait ? DM_DEVICE_WAITEVENT : DM_DEVICE_STATUS, 0, 0)))
11 years, 8 months
master - clvmd,lvmetad: check for fcntl result
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c6f680ee4945f2...
Commit: c6f680ee4945f22670d133ba341bb670c1d0a474
Parent: 5d0e7fb4edbe2c4e999eaa6210b6c9e25bdd5e91
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jun 20 10:49:16 2012 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Aug 23 14:38:48 2012 +0200
clvmd,lvmetad: check for fcntl result
Report any problem of fcntl.
---
daemons/clvmd/clvmd.c | 3 ++-
libdaemon/server/daemon-server.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/daemons/clvmd/clvmd.c b/daemons/clvmd/clvmd.c
index f74490a..ac465d9 100644
--- a/daemons/clvmd/clvmd.c
+++ b/daemons/clvmd/clvmd.c
@@ -2155,7 +2155,8 @@ static int open_local_sock(void)
/* Set Close-on-exec & non-blocking */
if (fcntl(local_socket, F_SETFD, 1))
DEBUGLOG("setting CLOEXEC on local_socket failed: %s\n", strerror(errno));
- fcntl(local_socket, F_SETFL, fcntl(local_socket, F_GETFL, 0) | O_NONBLOCK);
+ if (fcntl(local_socket, F_SETFL, fcntl(local_socket, F_GETFL, 0) | O_NONBLOCK))
+ DEBUGLOG("setting O_NONBLOCK on local_socket failed: %s\n", strerror(errno));
if (bind(local_socket, (struct sockaddr *) &sockaddr, sizeof(sockaddr))) {
diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
index df75ac7..ef26cbc 100644
--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -220,7 +220,8 @@ static int _open_socket(daemon_state s)
/* Set Close-on-exec & non-blocking */
if (fcntl(fd, F_SETFD, 1))
fprintf(stderr, "setting CLOEXEC on socket fd %d failed: %s\n", fd, strerror(errno));
- fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK);
+ if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK))
+ fprintf(stderr, "setting O_NONBLOCK on socket fd %d failed: %s\n", fd, strerror(errno));
fprintf(stderr, "[D] creating %s\n", s.socket_path);
if (!dm_strncpy(sockaddr.sun_path, s.socket_path, sizeof(sockaddr.sun_path))) {
11 years, 8 months
master - activation: report error message
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5d0e7fb4edbe2c...
Commit: 5d0e7fb4edbe2c4e999eaa6210b6c9e25bdd5e91
Parent: 57c0f72b1d0349382c226c2b5614489b59db99e8
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 29 10:18:28 2012 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Aug 23 14:38:48 2012 +0200
activation: report error message
If the monitoring activation failed and we have not yet
reported error - give the user error message for failure reason.
---
lib/activate/activate.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index 512adcf..185ba5f 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -1391,6 +1391,9 @@ int monitor_dev_for_events(struct cmd_context *cmd, struct logical_volume *lv,
r = (monitored && monitor) || (!monitored && !monitor);
}
+ if (!r && !error_message_produced())
+ log_error("%sonitoring %s/%s failed.", monitor ? "M" : "Not m",
+ lv->vg->name, lv->name);
return r;
#else
return 1;
11 years, 8 months
master - lvconvert: use _reload_lv on more places
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=57c0f72b1d0349...
Commit: 57c0f72b1d0349382c226c2b5614489b59db99e8
Parent: 4698fb0543637761fc11af76643f6b8e81a631a9
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Aug 2 11:38:07 2012 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Aug 23 14:38:45 2012 +0200
lvconvert: use _reload_lv on more places
Use common subroutine.
---
WHATS_NEW | 1 +
tools/lvconvert.c | 90 +++++++++++++++++-----------------------------------
2 files changed, 31 insertions(+), 60 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 1dcc5c2..9bd1739 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.98
=================================
+ Reuse _reload_lv() in more lvconvert functions.
Fix dereference of NULL in lvmetad error path logging.
Fix buffer memory leak in lvmetad logging.
Use 'ignore' discards for thin metadata created with older versions.
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 4c8dd50..2bfde24 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -492,32 +492,40 @@ static struct logical_volume *_get_lvconvert_lv(struct cmd_context *cmd __attrib
return lv;
}
-static int _reload_lv(struct cmd_context *cmd, struct logical_volume *lv)
+static int _reload_lv(struct cmd_context *cmd,
+ struct volume_group *vg,
+ struct logical_volume *lv)
{
+ int r = 0;
+
log_very_verbose("Updating logical volume \"%s\" on disk(s)", lv->name);
- if (!vg_write(lv->vg))
+ if (!vg_write(vg))
return_0;
if (!suspend_lv(cmd, lv)) {
log_error("Failed to lock %s", lv->name);
- vg_revert(lv->vg);
- return 0;
+ vg_revert(vg);
+ goto out;
}
- if (!vg_commit(lv->vg)) {
+ if (!vg_commit(vg)) {
if (!resume_lv(cmd, lv))
stack;
- return_0;
+ goto_out;
}
log_very_verbose("Updating \"%s\" in kernel", lv->name);
if (!resume_lv(cmd, lv)) {
log_error("Problem reactivating %s", lv->name);
- return 0;
+ goto out;
}
- return 1;
+
+ r = 1;
+out:
+ backup(vg);
+ return r;
}
static int _finish_lvconvert_mirror(struct cmd_context *cmd,
@@ -525,8 +533,6 @@ static int _finish_lvconvert_mirror(struct cmd_context *cmd,
struct logical_volume *lv,
struct dm_list *lvs_changed __attribute__((unused)))
{
- int r = 0;
-
if (!(lv->status & CONVERTING))
return 1;
@@ -539,32 +545,12 @@ static int _finish_lvconvert_mirror(struct cmd_context *cmd,
log_very_verbose("Updating logical volume \"%s\" on disk(s)", lv->name);
- if (!vg_write(vg))
+ if (!(_reload_lv(cmd, vg, lv)))
return_0;
- if (!suspend_lv(cmd, lv)) {
- log_error("Failed to lock %s", lv->name);
- vg_revert(vg);
- goto out;
- }
-
- if (!vg_commit(vg)) {
- resume_lv(cmd, lv);
- goto_out;
- }
-
- log_very_verbose("Updating \"%s\" in kernel", lv->name);
-
- if (!resume_lv(cmd, lv)) {
- log_error("Problem reactivating %s", lv->name);
- goto out;
- }
-
- r = 1;
log_print("Logical volume %s converted.", lv->name);
-out:
- backup(vg);
- return r;
+
+ return 1;
}
static int _finish_lvconvert_merge(struct cmd_context *cmd,
@@ -904,7 +890,6 @@ static int _lv_update_mirrored_log(struct logical_volume *lv,
operable_pvs, 0U);
}
-static int _reload_lv(struct cmd_context *cmd, struct logical_volume *lv);
static int _lv_update_log_type(struct cmd_context *cmd,
struct lvconvert_params *lp,
struct logical_volume *lv,
@@ -948,8 +933,10 @@ static int _lv_update_log_type(struct cmd_context *cmd,
* but it doesn't matter because we don't support
* mirrored logs in cluster mirrors.
*/
- if (old_log_count)
- return _reload_lv(cmd, log_lv);
+ if (old_log_count &&
+ !_reload_lv(cmd, log_lv->vg, log_lv))
+ return_0;
+
return 1;
}
@@ -1328,8 +1315,8 @@ out:
out_skip_log_convert:
- if (!_reload_lv(cmd, lv))
- return 0;
+ if (!_reload_lv(cmd, lv->vg, lv))
+ return_0;
return 1;
}
@@ -1369,8 +1356,8 @@ int mirror_remove_missing(struct cmd_context *cmd,
log_count))
return 0;
- if (!_reload_lv(cmd, lv))
- return 0;
+ if (!_reload_lv(cmd, lv->vg, lv))
+ return_0;
return 1;
}
@@ -1673,7 +1660,6 @@ static int lvconvert_snapshot(struct cmd_context *cmd,
struct lvconvert_params *lp)
{
struct logical_volume *org;
- int r = 0;
if (!(org = find_lv(lv->vg, lp->origin))) {
log_error("Couldn't find origin volume '%s'.", lp->origin);
@@ -1714,28 +1700,12 @@ static int lvconvert_snapshot(struct cmd_context *cmd,
}
/* store vg on disk(s) */
- if (!vg_write(lv->vg))
+ if (!_reload_lv(cmd, lv->vg, lv))
return_0;
- if (!suspend_lv(cmd, org)) {
- log_error("Failed to suspend origin %s", org->name);
- vg_revert(lv->vg);
- goto out;
- }
-
- if (!vg_commit(lv->vg))
- goto_out;
-
- if (!resume_lv(cmd, org)) {
- log_error("Problem reactivating origin %s", org->name);
- goto out;
- }
-
log_print("Logical volume %s converted to snapshot.", lv->name);
- r = 1;
-out:
- backup(lv->vg);
- return r;
+
+ return 1;
}
static int lvconvert_merge(struct cmd_context *cmd,
11 years, 8 months
master - lvconvert: move _reload_lv()
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4698fb05436377...
Commit: 4698fb0543637761fc11af76643f6b8e81a631a9
Parent: 243cd3fd2ca377d93fd7407f2a0109a04a189cbc
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Aug 1 15:34:45 2012 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Aug 23 14:37:52 2012 +0200
lvconvert: move _reload_lv()
Just move in front
---
tools/lvconvert.c | 55 +++++++++++++++++++++++++++--------------------------
1 files changed, 28 insertions(+), 27 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 76cc9b3..4c8dd50 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -492,6 +492,34 @@ static struct logical_volume *_get_lvconvert_lv(struct cmd_context *cmd __attrib
return lv;
}
+static int _reload_lv(struct cmd_context *cmd, struct logical_volume *lv)
+{
+ log_very_verbose("Updating logical volume \"%s\" on disk(s)", lv->name);
+
+ if (!vg_write(lv->vg))
+ return_0;
+
+ if (!suspend_lv(cmd, lv)) {
+ log_error("Failed to lock %s", lv->name);
+ vg_revert(lv->vg);
+ return 0;
+ }
+
+ if (!vg_commit(lv->vg)) {
+ if (!resume_lv(cmd, lv))
+ stack;
+ return_0;
+ }
+
+ log_very_verbose("Updating \"%s\" in kernel", lv->name);
+
+ if (!resume_lv(cmd, lv)) {
+ log_error("Problem reactivating %s", lv->name);
+ return 0;
+ }
+ return 1;
+}
+
static int _finish_lvconvert_mirror(struct cmd_context *cmd,
struct volume_group *vg,
struct logical_volume *lv,
@@ -1123,33 +1151,6 @@ static int _lvconvert_mirrors_parse_params(struct cmd_context *cmd,
return 1;
}
-static int _reload_lv(struct cmd_context *cmd, struct logical_volume *lv)
-{
- log_very_verbose("Updating logical volume \"%s\" on disk(s)", lv->name);
-
- if (!vg_write(lv->vg))
- return_0;
-
- if (!suspend_lv(cmd, lv)) {
- log_error("Failed to lock %s", lv->name);
- vg_revert(lv->vg);
- return 0;
- }
-
- if (!vg_commit(lv->vg)) {
- if (!resume_lv(cmd, lv))
- stack;
- return_0;
- }
-
- log_very_verbose("Updating \"%s\" in kernel", lv->name);
-
- if (!resume_lv(cmd, lv)) {
- log_error("Problem reactivating %s", lv->name);
- return 0;
- }
- return 1;
-}
/*
* _lvconvert_mirrors_aux
11 years, 8 months