Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=752b1e95f4f12225e6ed9…
Commit: 752b1e95f4f12225e6ed9302f078b3545e758549
Parent: 3d2fd95af78c6f8a34c2d602285bd2230d89b3fd
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Dec 5 11:31:58 2018 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Dec 5 11:31:58 2018 -0600
man lvmlockd: lvextend with gfs2
---
man/lvmlockd.8_main | 33 ++++++++++++++++++++++++++-------
1 files changed, 26 insertions(+), 7 deletions(-)
diff --git a/man/lvmlockd.8_main b/man/lvmlockd.8_main
index ebf57da..50b3473 100644
--- a/man/lvmlockd.8_main
+++ b/man/lvmlockd.8_main
@@ -773,6 +773,28 @@ vgchange --lock-type none --lock-opt force <vgname>
After the VG is local, follow the steps described in "changing a local VG
to a shared VG".
+.SS extending an LV active on multiple hosts
+
+With lvmlockd, a new procedure is required to extend an LV while it is
+active on multiple hosts (e.g. when used under gfs2):
+
+1. On one node run the lvextend command:
+.br
+.nf
+ lvextend --lockopt skiplv -L Size VG/LV
+.fi
+
+2. On each node using the LV, refresh the LV:
+.br
+.nf
+ lvchange --refresh VG/LV
+.fi
+
+3. On one node extend gfs2 (or comparable for other applications):
+.br
+.nf
+ gfs2_grow VG/LV
+.fi
.SS limitations of shared VGs
@@ -806,12 +828,12 @@ Visible usage differences between shared VGs (using lvmlockd) and
clvm/clustered VGs (using clvmd):
.IP \[bu] 2
-lvm.conf must be configured to use either lvmlockd (use_lvmlockd=1) or
-clvmd (locking_type=3), but not both.
+lvm.conf is configured to use lvmlockd by setting use_lvmlockd=1.
+clvmd used locking_type=3.
.IP \[bu] 2
-vgcreate --shared creates a shared VG, and vgcreate --clustered y
-creates a clvm/clustered VG.
+vgcreate --shared creates a shared VG. vgcreate --clustered y
+created a clvm/clustered VG.
.IP \[bu] 2
lvmlockd adds the option of using sanlock for locking, avoiding the
@@ -826,9 +848,6 @@ lvmlockd commands always apply to the local host, and never have an effect
on a remote host. (The activation option 'l' is not used.)
.IP \[bu] 2
-lvmlockd works with thin and cache pools and LVs.
-
-.IP \[bu] 2
lvmlockd saves the cluster name for a shared VG using dlm. Only hosts in
the matching cluster can use the VG.
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=89c11a2b49182f6858629…
Commit: 89c11a2b49182f6858629857b8c6b3ba126c5970
Parent: c1b2de936cf231c753c4c9f325d33ad5c746709e
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Dec 4 12:44:43 2018 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Dec 4 12:44:43 2018 -0600
remove unused lvmetad filter
---
lib/commands/toolcontext.c | 54 +++++++++++++-------------------------------
lib/commands/toolcontext.h | 1 -
2 files changed, 16 insertions(+), 39 deletions(-)
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index 754be86..8b2ab4e 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -1034,7 +1034,7 @@ static int _init_dev_cache(struct cmd_context *cmd)
#define MAX_FILTERS 10
-static struct dev_filter *_init_lvmetad_filter_chain(struct cmd_context *cmd)
+static struct dev_filter *_init_filter_chain(struct cmd_context *cmd)
{
int nr_filt = 0;
const struct dm_config_node *cn;
@@ -1143,27 +1143,9 @@ bad:
}
/*
- * The way the filtering is initialized depends on whether lvmetad is uesd or not.
- *
- * If lvmetad is used, there are three filter chains:
- *
- * - cmd->lvmetad_filter - the lvmetad filter chain used when scanning devs for lvmetad update:
- * sysfs filter -> internal filter -> global regex filter -> type filter ->
- * usable device filter(FILTER_MODE_PRE_LVMETAD) ->
- * mpath component filter -> partitioned filter ->
- * md component filter -> fw raid filter
- *
- * - cmd->filter - the filter chain used for lvmetad responses:
- * persistent filter -> regex_filter -> usable device filter(FILTER_MODE_POST_LVMETAD)
- *
- * - cmd->full_filter - the filter chain used for all the remaining situations:
- * cmd->lvmetad_filter -> cmd->filter
- *
- * If lvmetad is not used, there's just one filter chain:
- *
- * - cmd->filter == cmd->full_filter:
- * persistent filter -> sysfs filter -> internal filter -> global regex filter ->
- * regex_filter -> type filter -> usable device filter(FILTER_MODE_NO_LVMETAD) ->
+ * cmd->filter ==
+ * persistent(cache) filter -> sysfs filter -> internal filter -> global regex filter ->
+ * regex_filter -> type filter -> usable device filter ->
* mpath component filter -> partitioned filter -> md component filter -> fw raid filter
*
*/
@@ -1176,24 +1158,24 @@ int init_filters(struct cmd_context *cmd, unsigned load_persistent_cache)
return 0;
}
- cmd->lvmetad_filter = _init_lvmetad_filter_chain(cmd);
- if (!cmd->lvmetad_filter)
+ filter = _init_filter_chain(cmd);
+ if (!filter)
goto_bad;
init_ignore_suspended_devices(find_config_tree_bool(cmd, devices_ignore_suspended_devices_CFG, NULL));
init_ignore_lvm_mirrors(find_config_tree_bool(cmd, devices_ignore_lvm_mirrors_CFG, NULL));
/*
- * If lvmetad is used, there's a separation between pre-lvmetad filter chain
- * ("cmd->lvmetad_filter") applied only if scanning for lvmetad update and
- * post-lvmetad filter chain ("filter") applied on each lvmetad response.
- * However, if lvmetad is not used, these two chains are not separated
- * and we use exactly one filter chain during device scanning ("filter"
- * that includes also "cmd->lvmetad_filter" chain).
+ * persisent filter is a cache of the previous result real filter result.
+ * If a dev is found in persistent filter, the pass/fail result saved by
+ * the pfilter is used. If a dev does not existing in the persistent
+ * filter, the dev is passed on to the real filter, and when the result
+ * of the real filter is saved in the persistent filter.
+ *
+ * FIXME: we should apply the filter once at the start of the command,
+ * and not call the filters repeatedly. In that case we would not need
+ * the persistent/caching filter layer.
*/
- filter = cmd->lvmetad_filter;
- cmd->lvmetad_filter = NULL;
-
if (!(pfilter = persistent_filter_create(cmd->dev_types, filter))) {
log_verbose("Failed to create persistent device filter.");
goto bad;
@@ -1223,10 +1205,6 @@ bad:
filter->destroy(filter);
}
- /* if lvmetad is used, the cmd->lvmetad_filter is separate */
- if (cmd->lvmetad_filter)
- cmd->lvmetad_filter->destroy(cmd->lvmetad_filter);
-
cmd->initialized.filters = 0;
return 0;
}
@@ -1858,7 +1836,7 @@ static void _destroy_filters(struct cmd_context *cmd)
{
if (cmd->full_filter) {
cmd->full_filter->destroy(cmd->full_filter);
- cmd->lvmetad_filter = cmd->filter = cmd->full_filter = NULL;
+ cmd->filter = cmd->full_filter = NULL;
}
cmd->initialized.filters = 0;
}
diff --git a/lib/commands/toolcontext.h b/lib/commands/toolcontext.h
index 2ac7a1e..f820ba1 100644
--- a/lib/commands/toolcontext.h
+++ b/lib/commands/toolcontext.h
@@ -176,7 +176,6 @@ struct cmd_context {
/*
* Filtering.
*/
- struct dev_filter *lvmetad_filter; /* pre-lvmetad filter chain */
struct dev_filter *filter; /* post-lvmetad filter chain */
struct dev_filter *full_filter; /* lvmetad_filter + filter */