master - libdm: preload propagates delayed resume
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=aa68b898ff9c51dcbd8...
Commit: aa68b898ff9c51dcbd87c6be34632e33f0299a18
Parent: b5be7420d947b9bfe52da73078955ed241765875
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Nov 24 13:57:22 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Nov 24 16:05:21 2017 +0100
libdm: preload propagates delayed resume
Propagate delayed resume at least for preload case in a simple way.
Currently PVMOVE depends on internal logic where 'mirror' with
corelog is 'possible' PVMOVE. In such case resume of 'created'
node is 'delayed'.
This is mostly an ugly internal hack - but for the moment being when we
add propagation for preload - it does work reasonable.
TODO: provide standard API and avoid this internal 'guessing'.
---
WHATS_NEW_DM | 1 +
libdm/libdm-deptree.c | 4 ++++
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index b7f71ca..9cec953 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.146 -
====================================
+ Propagate delayed resume for pvmove subvolumes.
Suppress integrity encryption keys in 'table' output unless --showkeys supplied.
Version 1.02.145 - 3rd November 2017
diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c
index b0a48f3..547904f 100644
--- a/libdm/libdm-deptree.c
+++ b/libdm/libdm-deptree.c
@@ -2962,6 +2962,10 @@ int dm_tree_preload_children(struct dm_tree_node *dnode,
/* Preload children first */
while ((child = dm_tree_next_child(&handle, dnode, 0))) {
+ /* Propagate delay of resume from parent node */
+ if (dnode->props.delay_resume_if_new)
+ child->props.delay_resume_if_new = 1;
+
/* Skip existing non-device-mapper devices */
if (!child->info.exists && child->info.major)
continue;
6 years, 4 months
master - locking: pvmove is locking holding LV
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b5be7420d947b9bfe52...
Commit: b5be7420d947b9bfe52da73078955ed241765875
Parent: 8cf10948bd3acce7ae03f16982f0acbc4cde4fee
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Nov 24 13:55:57 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Nov 24 16:05:21 2017 +0100
locking: pvmove is locking holding LV
As we do get lock for pvmove LV - it's lockholder ATM.
---
WHATS_NEW | 1 +
lib/metadata/lv.c | 3 +++
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 6ff4ccd..f29a498 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.177 -
====================================
+ Make a pvmove LV locking holder.
Do not change critical section counter on resume path without real resume.
Enhance activation code to automatically suspend pvmove participants.
Remove unnecessary single read from lvmdiskscan.
diff --git a/lib/metadata/lv.c b/lib/metadata/lv.c
index 4d35efe..630880f 100644
--- a/lib/metadata/lv.c
+++ b/lib/metadata/lv.c
@@ -1604,6 +1604,9 @@ const struct logical_volume *lv_lock_holder(const struct logical_volume *lv)
if ((lv_is_raid_image(lv) || lv_is_raid_metadata(lv)) && lv_is_visible(lv))
return lv;
+ if (lv_is_pvmove(lv))
+ return lv;
+
/* For other types, by default look for the first user */
dm_list_iterate_items(sl, &lv->segs_using_this_lv) {
/* FIXME: complete this exception list */
6 years, 4 months
master - resume: secure critical section
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=8cf10948bd3acce7ae0...
Commit: 8cf10948bd3acce7ae03f16982f0acbc4cde4fee
Parent: ae6beda12ddd203b806c565faabb5715379eaf85
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Nov 24 13:53:02 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Nov 24 16:05:21 2017 +0100
resume: secure critical section
Only thin-pool with origin_only suspend is allowed to be not suspending anything.
In such case pairing resume will 'decrement' critical section counter.
---
WHATS_NEW | 1 +
lib/activate/activate.c | 8 +++++++-
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 5ffe0ed..6ff4ccd 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.177 -
====================================
+ Do not change critical section counter on resume path without real resume.
Enhance activation code to automatically suspend pvmove participants.
Remove unnecessary single read from lvmdiskscan.
Avoid using precommitted metadata for suspending pvmove tree.
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index fe2fcc6..17bbe15 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -2353,11 +2353,17 @@ static int _lv_resume(struct cmd_context *cmd, const char *lvid_s,
if (error_if_not_active)
goto_out;
+
+ /* ATM only thin-pool with origin-only suspend does not really suspend anything
+ * it's used only for message passing to thin-pool */
+ if (laopts->origin_only && lv_is_thin_pool(lv))
+ critical_section_dec(cmd, "resumed");
+
if (!info.suspended && critical_section()) {
/* check if any subLV is suspended */
if ((r = for_each_sub_lv((struct logical_volume *)lv, &_check_suspended_lv, NULL))) {
/* Everything seems resumed */
- critical_section_dec(cmd, "already resumed");
+ log_debug_activation("LV %s not suspended.", display_lvname(lv));
goto out;
}
} else {
6 years, 4 months
master - suspend: handle start of pvmove
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=ae6beda12ddd203b806...
Commit: ae6beda12ddd203b806c565faabb5715379eaf85
Parent: 175d06a92940dda5de3a7631e3d27cd6828a16be
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Nov 24 13:51:17 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Nov 24 16:05:21 2017 +0100
suspend: handle start of pvmove
Just like suspend handles preload for pvmove finish,
in similar way handle suspend of starting pvmove.
In this case the precommited metadata are checked for list of PVMOVEed
LVs and those are suspended in with committed metadata.
---
WHATS_NEW | 1 +
lib/activate/activate.c | 52 +++++++++++++++++++++++++++++++++++++++++++---
2 files changed, 49 insertions(+), 4 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 03d1e04..5ffe0ed 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.177 -
====================================
+ Enhance activation code to automatically suspend pvmove participants.
Remove unnecessary single read from lvmdiskscan.
Avoid using precommitted metadata for suspending pvmove tree.
Ehnance pvmove locking.
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index efcecde..fe2fcc6 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -2095,6 +2095,9 @@ static int _lv_suspend(struct cmd_context *cmd, const char *lvid_s,
struct lvinfo info;
int r = 0, lockfs = 0, flush_required = 0;
struct detached_lv_data detached;
+ struct dm_pool *mem = NULL;
+ struct dm_list suspend_lvs;
+ struct lv_list *lvl;
if (!activation())
return 1;
@@ -2226,13 +2229,54 @@ static int _lv_suspend(struct cmd_context *cmd, const char *lvid_s,
lockfs = 1;
critical_section_inc(cmd, "suspending");
- if (!_lv_suspend_lv(lv, laopts, lockfs, flush_required)) {
- critical_section_dec(cmd, "failed suspend");
- goto_out;
- }
+
+ if (!lv_is_locked(lv) && lv_is_locked(lv_pre) &&
+ (pvmove_lv = find_pvmove_lv_in_lv(lv_pre))) {
+ /*
+ * When starting PVMOVE, suspend participating LVs first
+ * with committed metadata by looking at precommited pvmove list.
+ * In committed metadata these LVs are not connected in any way.
+ *
+ * TODO: prepare list of LVs needed to be suspended and pass them
+ * via 'struct laopts' directly to _lv_suspend_lv() and handle this
+ * with a single 'dmtree' call.
+ */
+ if (!(mem = dm_pool_create("suspend_lvs", 128)))
+ goto_out;
+
+ /* Prepare list of all LVs for suspend ahead */
+ dm_list_init(&suspend_lvs);
+ dm_list_iterate_items(sl, &pvmove_lv->segs_using_this_lv) {
+ if (!(lvl = dm_pool_alloc(mem, sizeof(*lvl)))) {
+ log_error("lv_list alloc failed.");
+ goto out;
+ }
+ /* Look for precommitted LV name in commmitted VG */
+ if (!(lvl->lv = find_lv(lv->vg, sl->seg->lv->name))) {
+ log_error(INTERNAL_ERROR "LV %s missing from preload metadata.",
+ display_lvname(sl->seg->lv));
+ goto out;
+ }
+ /* Never suspend COW, always has to be origin */
+ if (lv_is_cow(lvl->lv))
+ lvl->lv = origin_from_cow(lvl->lv);
+ dm_list_add(&suspend_lvs, &lvl->list);
+ }
+ dm_list_iterate_items(lvl, &suspend_lvs)
+ if (!_lv_suspend_lv(lvl->lv, laopts, lockfs, 1)) {
+ critical_section_dec(cmd, "failed suspend");
+ goto_out; /* FIXME: resume on recovery path? */
+ }
+ } else /* Standard suspend */
+ if (!_lv_suspend_lv(lv, laopts, lockfs, flush_required)) {
+ critical_section_dec(cmd, "failed suspend");
+ goto_out;
+ }
r = 1;
out:
+ if (mem)
+ dm_pool_destroy(mem);
if (lv_pre_to_free)
release_vg(lv_pre_to_free->vg);
if (lv_to_free)
6 years, 4 months
master - lvconvert: prevent combining split snapshots in shared vg
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=175d06a92940dda5de3...
Commit: 175d06a92940dda5de3a7631e3d27cd6828a16be
Parent: ea0463791dcc68082ecf0b6b6681e82becaffb40
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Nov 21 11:45:49 2017 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Nov 21 11:45:49 2017 -0600
lvconvert: prevent combining split snapshots in shared vg
splitting snapshots was already prevented.
---
tools/lvconvert.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index eab7e6d..ed1a130 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -3828,6 +3828,11 @@ static int _lvconvert_combine_split_snapshot_single(struct cmd_context *cmd,
{
const char *origin_name = cmd->position_argv[0];
+ if (is_lockd_type(lv->vg->lock_type)) {
+ log_error("Unable to combine split snapshots in VG with lock_type %s", lv->vg->lock_type);
+ return ECMD_FAILED;
+ }
+
/* If origin_name includes VG name, the VG name is removed. */
if (!validate_lvname_param(cmd, &lv->vg->name, &origin_name))
return_ECMD_FAILED;
6 years, 4 months
master - man: lvmlockd steps for changing lock type
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=ea0463791dcc68082ec...
Commit: ea0463791dcc68082ecf0b6b6681e82becaffb40
Parent: bbaaf4f1d34a1a097c20dca1f36a0f6a50c5d066
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Nov 21 10:37:00 2017 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Nov 21 10:37:00 2017 -0600
man: lvmlockd steps for changing lock type
were not quite correct
---
man/lvmlockd.8_main | 45 +++++++++++++++++++++++++++++++++++++--------
1 files changed, 37 insertions(+), 8 deletions(-)
diff --git a/man/lvmlockd.8_main b/man/lvmlockd.8_main
index b7eba1a..fbcdc87 100644
--- a/man/lvmlockd.8_main
+++ b/man/lvmlockd.8_main
@@ -706,19 +706,24 @@ To change the dlm cluster name in the VG when the VG is still used by the
original cluster:
.IP \[bu] 2
-Stop the VG on all hosts:
+Start the VG on the host changing the lock type
+.br
+vgchange --lock-start <vgname>
+
+.IP \[bu] 2
+Stop the VG on all other hosts:
.br
vgchange --lock-stop <vgname>
.IP \[bu] 2
-Change the VG lock type to none:
+Change the VG lock type to none on the host where the VG is started:
.br
vgchange --lock-type none <vgname>
.IP \[bu] 2
-Change the dlm cluster name on the host or move the VG to the new cluster.
-The new dlm cluster must now be active on the host. Verify the new name
-by:
+Change the dlm cluster name on the hosts or move the VG to the new
+cluster. The new dlm cluster must now be running on the host. Verify the
+new name by:
.br
cat /sys/kernel/config/dlm/cluster/cluster_name
@@ -735,13 +740,14 @@ vgchange --lock-start <vgname>
.P
To change the dlm cluster name in the VG when the dlm cluster name has
-already changed, or the VG has already moved to a different cluster:
+already been changed on the hosts, or the VG has already moved to a
+different cluster:
.IP \[bu] 2
Ensure the VG is not being used by any hosts.
.IP \[bu] 2
-The new dlm cluster must be active on the host making the change.
+The new dlm cluster must be running on the host making the change.
The current dlm cluster name can be seen by:
.br
cat /sys/kernel/config/dlm/cluster/cluster_name
@@ -768,21 +774,44 @@ All LVs must be inactive to change the lock type.
lvmlockd must be configured and running as described in USAGE.
+.IP \[bu] 2
Change a local VG to a lockd VG with the command:
.br
vgchange --lock-type sanlock|dlm <vgname>
+.IP \[bu] 2
Start the VG on hosts to use it:
.br
vgchange --lock-start <vgname>
+.P
.SS changing a lockd VG to a local VG
-Stop the lockd VG on all hosts, then run:
+All LVs must be inactive to change the lock type.
+
+.IP \[bu] 2
+Start the VG on the host making the change:
+.br
+vgchange --lock-start <vgname>
+
+.IP \[bu] 2
+Stop the VG on all other hosts:
+.br
+vgchange --lock-stop <vgname>
+
+.IP \[bu] 2
+Change the VG lock type to none on the host where the VG is started:
.br
vgchange --lock-type none <vgname>
+.P
+
+If the VG cannot be started with the previous lock type, then the lock
+type can be forcibly changed to none with:
+
+vgchange --lock-type none --lock-opt force <vgname>
+
To change a VG from one lockd type to another (i.e. between sanlock and
dlm), first change it to a local VG, then to the new type.
6 years, 4 months
master - lvmlockd: override unknown lock manager error numbers
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=bbaaf4f1d34a1a097c2...
Commit: bbaaf4f1d34a1a097c20dca1f36a0f6a50c5d066
Parent: e52d2e3bd86a006bcc322649ac9cb7c52117b787
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Nov 15 16:00:41 2017 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Nov 17 10:59:12 2017 -0600
lvmlockd: override unknown lock manager error numbers
When sanlock or dlm lock managers return an error number
that we don't recognize, replace it with a generic -ELMERR
which is defined in the set of special lvmlockd error
numbers. Otherwise, an unknown lock manager error number
could be misinterpreted for something else if it happened
to overlap another set of error numbers (which they have
not thus far.)
---
daemons/lvmlockd/lvmlockd-client.h | 1 +
daemons/lvmlockd/lvmlockd-dlm.c | 4 +++-
daemons/lvmlockd/lvmlockd-sanlock.c | 24 +++++++++++++++++++++++-
3 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/daemons/lvmlockd/lvmlockd-client.h b/daemons/lvmlockd/lvmlockd-client.h
index 1d42338..bc90596 100644
--- a/daemons/lvmlockd/lvmlockd-client.h
+++ b/daemons/lvmlockd/lvmlockd-client.h
@@ -49,5 +49,6 @@ static inline void lvmlockd_close(daemon_handle h)
#define ELOCKIO 218 /* sanlock io errors during lock op, may be transient. */
#define EREMOVED 219
#define EDEVOPEN 220 /* sanlock failed to open lvmlock LV */
+#define ELMERR 221
#endif /* _LVM_LVMLOCKD_CLIENT_H */
diff --git a/daemons/lvmlockd/lvmlockd-dlm.c b/daemons/lvmlockd/lvmlockd-dlm.c
index 280cf2b..9440821 100644
--- a/daemons/lvmlockd/lvmlockd-dlm.c
+++ b/daemons/lvmlockd/lvmlockd-dlm.c
@@ -508,7 +508,7 @@ lockrv:
}
if (rv < 0) {
log_error("S %s R %s lock_dlm acquire error %d errno %d", ls->name, r->name, rv, errno);
- return rv;
+ return -ELMERR;
}
if (rdd->vb) {
@@ -581,6 +581,7 @@ int lm_convert_dlm(struct lockspace *ls, struct resource *r,
}
if (rv < 0) {
log_error("S %s R %s convert_dlm error %d", ls->name, r->name, rv);
+ rv = -ELMERR;
}
return rv;
}
@@ -654,6 +655,7 @@ int lm_unlock_dlm(struct lockspace *ls, struct resource *r,
0, NULL, NULL, NULL);
if (rv < 0) {
log_error("S %s R %s unlock_dlm error %d", ls->name, r->name, rv);
+ rv = -ELMERR;
}
return rv;
diff --git a/daemons/lvmlockd/lvmlockd-sanlock.c b/daemons/lvmlockd/lvmlockd-sanlock.c
index acec7dc..358c588 100644
--- a/daemons/lvmlockd/lvmlockd-sanlock.c
+++ b/daemons/lvmlockd/lvmlockd-sanlock.c
@@ -1460,6 +1460,12 @@ int lm_lock_sanlock(struct lockspace *ls, struct resource *r, int ld_mode,
rv = sanlock_acquire(lms->sock, -1, flags, 1, &rs, &opt);
+ /*
+ * errors: translate the sanlock error number to an lvmlockd error.
+ * We don't want to return an sanlock-specific error number from
+ * this function to code that doesn't recognize sanlock error numbers.
+ */
+
if (rv == -EAGAIN) {
/*
* It appears that sanlock_acquire returns EAGAIN when we request
@@ -1598,15 +1604,25 @@ int lm_lock_sanlock(struct lockspace *ls, struct resource *r, int ld_mode,
if (rv == -ENOSPC)
rv = -ELOCKIO;
- return rv;
+ /*
+ * generic error number for sanlock errors that we are not
+ * catching above.
+ */
+ return -ELMERR;
}
+ /*
+ * sanlock acquire success (rv 0)
+ */
+
if (rds->vb) {
rv = sanlock_get_lvb(0, rs, (char *)&vb, sizeof(vb));
if (rv < 0) {
log_error("S %s R %s lock_san get_lvb error %d", ls->name, r->name, rv);
memset(rds->vb, 0, sizeof(struct val_blk));
memset(vb_out, 0, sizeof(struct val_blk));
+ /* the lock is still acquired, the vb values considered invalid */
+ rv = 0;
goto out;
}
@@ -1659,6 +1675,7 @@ int lm_convert_sanlock(struct lockspace *ls, struct resource *r,
if (rv < 0) {
log_error("S %s R %s convert_san set_lvb error %d",
ls->name, r->name, rv);
+ rv = -ELMERR;
}
}
@@ -1679,6 +1696,7 @@ int lm_convert_sanlock(struct lockspace *ls, struct resource *r,
}
if (rv < 0) {
log_error("S %s R %s convert_san convert error %d", ls->name, r->name, rv);
+ rv = -ELMERR;
}
return rv;
@@ -1715,6 +1733,7 @@ static int release_rename(struct lockspace *ls, struct resource *r)
rv = sanlock_release(lms->sock, -1, SANLK_REL_RENAME, 2, res_args);
if (rv < 0) {
log_error("S %s R %s unlock_san release rename error %d", ls->name, r->name, rv);
+ rv = -ELMERR;
}
free(res_args);
@@ -1771,6 +1790,7 @@ int lm_unlock_sanlock(struct lockspace *ls, struct resource *r,
if (rv < 0) {
log_error("S %s R %s unlock_san set_lvb error %d",
ls->name, r->name, rv);
+ rv = -ELMERR;
}
}
@@ -1789,6 +1809,8 @@ int lm_unlock_sanlock(struct lockspace *ls, struct resource *r,
if (rv == -EIO)
rv = -ELOCKIO;
+ else if (rv < 0)
+ rv = -ELMERR;
return rv;
}
6 years, 4 months
master - lvmlockd: retry on other sanlock errors
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e52d2e3bd86a006bcc3...
Commit: e52d2e3bd86a006bcc322649ac9cb7c52117b787
Parent: 115e66e9bedaa5d6edfd436fb78aba2c753deeb7
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Nov 15 15:34:42 2017 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Nov 17 10:59:12 2017 -0600
lvmlockd: retry on other sanlock errors
These less common errors returned from sanlock should
also cause sanlock to retry the lock acquire:
- i/o timeout occurs during sanlock_acquire().
other i/o on the same disk as the leases can cause
sanlock i/o timeouts.
- low level disk paxos contention between hosts naturally
causes one host to not acquire the lease. There are a
couple special error numbers associated with these cases
that should just be recognized as a normal failure to
acquire the lease.
---
daemons/lvmlockd/lvmlockd-sanlock.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/daemons/lvmlockd/lvmlockd-sanlock.c b/daemons/lvmlockd/lvmlockd-sanlock.c
index 0e81915..acec7dc 100644
--- a/daemons/lvmlockd/lvmlockd-sanlock.c
+++ b/daemons/lvmlockd/lvmlockd-sanlock.c
@@ -1528,6 +1528,26 @@ int lm_lock_sanlock(struct lockspace *ls, struct resource *r, int ld_mode,
return -EAGAIN;
}
+ if (rv == SANLK_AIO_TIMEOUT) {
+ /*
+ * sanlock got an i/o timeout when trying to acquire the
+ * lease on disk.
+ */
+ log_debug("S %s R %s lock_san acquire mode %d rv %d", ls->name, r->name, ld_mode, rv);
+ *retry = 0;
+ return -EAGAIN;
+ }
+
+ if (rv == SANLK_DBLOCK_LVER || rv == SANLK_DBLOCK_MBAL) {
+ /*
+ * There was contention with another host for the lease,
+ * and we lost.
+ */
+ log_debug("S %s R %s lock_san acquire mode %d rv %d", ls->name, r->name, ld_mode, rv);
+ *retry = 0;
+ return -EAGAIN;
+ }
+
if (rv == SANLK_ACQUIRE_OWNED_RETRY) {
/*
* The lock is held by a failed host, and will eventually
6 years, 4 months
master - device: log debug when I/O bounce buffer used
by Alasdair Kergon
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=115e66e9bedaa5d6edf...
Commit: 115e66e9bedaa5d6edfd436fb78aba2c753deeb7
Parent: efb0e7ac6f5d4f12628f47c53c1a635b5e51dee5
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Thu Nov 16 19:16:10 2017 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Thu Nov 16 19:16:10 2017 +0000
device: log debug when I/O bounce buffer used
---
lib/device/dev-io.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/lib/device/dev-io.c b/lib/device/dev-io.c
index 24bc81c..35c510f 100644
--- a/lib/device/dev-io.c
+++ b/lib/device/dev-io.c
@@ -234,6 +234,9 @@ static int _aligned_io(struct device_area *where, char *buffer,
!((uintptr_t) buffer & mask))
return _io(where, buffer, should_write);
+ log_debug_io("Widening request for %" PRIu64 " bytes at %" PRIu64 " to %" PRIu64 " bytes at %" PRIu64 " on %s",
+ where->size, (uint64_t) where->start, widened.size, (uint64_t) widened.start, dev_name(where->dev));
+
/* Allocate a bounce buffer with an extra block */
if (!(bounce_buf = bounce = dm_malloc((size_t) widened.size + block_size))) {
log_error("Bounce buffer malloc failed");
6 years, 4 months
master - lvmdiskscan: Remove unnecessary read.
by Alasdair Kergon
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=efb0e7ac6f5d4f12628...
Commit: efb0e7ac6f5d4f12628f47c53c1a635b5e51dee5
Parent: 93c02e2532c71f5afe91605442a8acc059df982c
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Thu Nov 16 19:13:03 2017 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Thu Nov 16 19:13:03 2017 +0000
lvmdiskscan: Remove unnecessary read.
dev_get_size will open the device itself.
---
WHATS_NEW | 1 +
tools/lvmdiskscan.c | 15 +--------------
2 files changed, 2 insertions(+), 14 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index ff60758..03d1e04 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.177 -
====================================
+ Remove unnecessary single read from lvmdiskscan.
Avoid using precommitted metadata for suspending pvmove tree.
Ehnance pvmove locking.
Deactivate activated LVs on error path when pvmove activation fails.
diff --git a/tools/lvmdiskscan.c b/tools/lvmdiskscan.c
index bd0d705..cb688b5 100644
--- a/tools/lvmdiskscan.c
+++ b/tools/lvmdiskscan.c
@@ -69,28 +69,15 @@ static void _print(struct cmd_context *cmd, const struct device *dev,
static int _check_device(struct cmd_context *cmd, struct device *dev)
{
- char buffer;
uint64_t size;
- if (!dev_open_readonly(dev))
- return_0;
-
- if (!dev_read(dev, UINT64_C(0), (size_t) 1, &buffer)) {
- stack;
- if (!dev_close(dev))
- stack;
- return 0;
- }
if (!dev_get_size(dev, &size)) {
log_error("Couldn't get size of \"%s\"", dev_name(dev));
size = 0;
}
_print(cmd, dev, size, NULL);
_count(dev, &disks_found, &parts_found);
- if (!dev_close(dev)) {
- log_error("dev_close on \"%s\" failed", dev_name(dev));
- return 0;
- }
+
return 1;
}
6 years, 4 months