master - bcache: remove extraneous error message
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f85a010a6bc9dc0414c...
Commit: f85a010a6bc9dc0414ccdf9c6b195c78231f1914
Parent: 565df4e7321243614fd18c6a45d1f890ab92956b
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Jun 18 11:59:57 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Jun 18 12:02:22 2018 -0500
bcache: remove extraneous error message
an error from io_submit is already recognized by
the caller like errors during completion.
---
lib/device/bcache.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/lib/device/bcache.c b/lib/device/bcache.c
index f4c0712..f315b2a 100644
--- a/lib/device/bcache.c
+++ b/lib/device/bcache.c
@@ -191,7 +191,6 @@ static bool _async_issue(struct io_engine *ioe, enum dir d, int fd,
} while (r == -EAGAIN);
if (r < 0) {
- log_sys_warn("io_submit");
_cb_free(e->cbs, cb);
return false;
}
6 years
master - Print advice about changing clustered VGs to shared
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=565df4e7321243614fd...
Commit: 565df4e7321243614fd18c6a45d1f890ab92956b
Parent: 428514a07f4bd270f6a137f08be1b2818312bdbd
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Jun 18 10:59:11 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Jun 18 10:59:11 2018 -0500
Print advice about changing clustered VGs to shared
---
tools/toollib.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/tools/toollib.c b/tools/toollib.c
index ebf2509..f0cf78e 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -173,6 +173,8 @@ const char *skip_dev_dir(struct cmd_context *cmd, const char *vg_name,
return vg_name;
}
+static int _printed_clustered_vg_advice = 0;
+
/*
* Three possible results:
* a) return 0, skip 0: take the VG, and cmd will end in success
@@ -206,10 +208,18 @@ static int _ignore_vg(struct volume_group *vg, const char *vg_name,
if (read_error & FAILED_CLUSTERED) {
if (arg_vgnames && str_list_match_item(arg_vgnames, vg->name)) {
- log_error("Cannot access clustered VG %s, see lvmlockd(8).", vg->name);
+ log_error("Cannot access clustered VG %s.", vg->name);
+ if (!_printed_clustered_vg_advice) {
+ _printed_clustered_vg_advice = 1;
+ log_error("See lvmlockd(8) for changing a clvm/clustered VG to a shared VG.");
+ }
return 1;
} else {
log_warn("Skipping clustered VG %s.", vg_name);
+ if (!_printed_clustered_vg_advice) {
+ _printed_clustered_vg_advice = 1;
+ log_error("See lvmlockd(8) for changing a clvm/clustered VG to a shared VG.");
+ }
*skip = 1;
return 0;
}
6 years
v2_02_179 annotated tag has been created
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f426de669957e39d62a...
Commit: f426de669957e39d62ad26748b9e6704571f7456
Parent: 0000000000000000000000000000000000000000
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: 2018-06-18 05:22 +0000
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: 2018-06-18 05:22 +0000
annotated tag: v2_02_179 has been created
at f426de669957e39d62ad26748b9e6704571f7456 (tag)
tagging 6283f5ea3f33fa022ec1f25baba630cbc5fdd1c5 (commit)
replaces v2_02_178
Release 2.02.179
Bug fix release, fixing mostly problems with cache a lvmlockd.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
iQIcBAABAgAGBQJbJ0H2AAoJELkRJDHlCQOfCrQP/iWdSFUtDn2qnL5k6PMjV+co
iVVd0PAkMkbra6Xesxhz6tePAV6WyYdswQmdgGKhnko/BtjuO88kFjEriLqS0sux
YRakjqoXKOW7RZgTeEowYeGQX1Rxl0Oos/xG/KJRVS0O3/QAojQsOeQ6VSdpvlKV
10g/G2/pdIxa9bwMOlQMKQAJnoS8bRJ4+4W8c5wFNJi2OZLcPyoSQYwiLDpeUhYo
xqJlgnzvkqEfaMg/INpdWgqvpC0slXcV2I7fNvqZdEQTgFdSLjncGRB3lWR4Pl4A
f0/rLGgtOpCW48zNgUxpdx1TYOEf45OOXINfy8M/R8D1yoa1f3r1b6IRfrM+kXN4
Kv7q2TDfleO92nZ3xPyPVx3bLsX555sFLqK6OnKxoKHcHTLM+A6Qtdvd2I/xmZQv
TmUCmp+CGsmMx/IwWF9Buoq67hXeGn9YDiOK1bkVcKOr8p5Gp++2pN2yN8f1Kb83
Qi7HGWQf/P+Ya6+qf/BqFnWxy7BNstUXCRJ7cZdmiMiSB5oWNxrABopID/QfIcXo
B8tPm49P3N7U3dBrzl0Dz4KiK9B3MKOBx2AtvSkctXYOPrbOMOe20oOfBPj6XnD9
OaHqKvB8u+gVgonFf/oiuoEsQD95EYYZc3IFYOGJ0fb5dCTje4CkVVSujUyopU00
I5X+Y5te3LGivWIVZfNn
=M1dD
-----END PGP SIGNATURE-----
Alasdair G Kergon (1):
format_text: Use versionsort to sort archive files
David Teigland (42):
scan: refresh paths and retry open
scan: removed failed paths for devices
tests: fix skipping logic for lvmpolld and lvmlockd
tests: some missed skip with lvmlockd
lvmlockd: accept repeated global lock requests
tests: separate lvmlockd tests with or without lvmetad
lvmlockd: do not use an LV lock for some lvchange options
config: revert to normal locking when no cluster
lvmlockd: enable mirror split and merge with dlm lock_type
lvmlockd: enable lvcreate of thin pool and thin lv in one command
lvmlockd: enable creation of cache pool with lvcreate
tests: enable lvmlockd for passing tests
tests: vgcreate-usage update for lvmlockd
tests: vgchange-usage update for lvmlockd
lvmlockd: fix vgimportclone of a shared VG
pvremove: skip lvmlockd locks for forced clearing
tests: process-each-duplicate-pvs update for lvmlockd
tests: add missing file
lvmlockd: enable repairing shared VG while reading it
tests: enable vg repair tests with lvmlockd
tests: enable pvmove-restart with lvmlockd
lvmlockd: enable lvcreate of new LV plus existing cache pool
tests: enable lvcreate cache tests with lvmlockd
tests: change lvcreate syntax to allow lvmlockd
vgs: add report field for shared
lvmlockd: enable lvcreate -H -L LV
tests: enable lvmlockd with tests using lvcreate -H -L LV
tests: enable metadata-balance with lvmlockd
lvmlockd: fix reverting new lv in error path
tests: enable lvcreate-pvtags with lvmlockd
lvmlockd: improve error message for existing lockspace
tests: enable more working tests with lvmlockd
tests: enable non-working tests with lvmlockd
man lvmlockd: update list of limitations
devices: clean up io error messages
lvmlockd: fix missing lock_type null check
man lvmlockd: remove unnecessary reference to lvmetad
lvmlockd: skip repair lock upgrade for non shared vgs
WHATS_NEW for recent changes
lvmlockd: update method for changing clustered VG
man: updates to lvmlockd
man: update lvmsystemid wording
Joe Thornber (8):
radix_tree: add remove method
radix_tree_t: knock out some debug
data-struct/radix-tree: pass the value dtr into create.
Merge branch '2018-05-29-radix-tree-iterate' into 2018-05-23-radix-tree-remove
radix-tree: call the value dtr when removing an entry.
radix-tree: radix_tree_remove_prefix()
radix-tree: radix_tree_iterate()
radix-tree: fix some bugs in remove_prefix and iterate
Marian Csontos (5):
post-release
Merge remote-tracking branch 'origin/master'
post-release
Merge branch 'dev-mcsontos-release' into stable
pre-release
Zdenek Kabelac (2):
man: another missed typo for thin plugin
tests: improve usability on older systems
6 years
master - Drop --ignoreskippedcluster option
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=428514a07f4bd270f6a...
Commit: 428514a07f4bd270f6a137f08be1b2818312bdbd
Parent: ccab4a1994f4218810f1a6152cf6c71caa00977e
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Jun 15 15:43:59 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Jun 15 15:59:34 2018 -0500
Drop --ignoreskippedcluster option
It's no longer needed. Clustered VGs are now handled in
the same way as foreign VGs, and as shared VGs that
can't be accessed:
- A command processing all VGs sees a clustered VG,
prints a message ("Skipping clustered VG foo."),
skips it, and does not fail.
- A command where the clustered VG is explicitly
named on the command line, prints a message and fails.
"Cannot access clustered VG foo, see lvmlockd(8)."
The option is listed in the set of ignored options for
the commands that previously accepted it. (Removing it
entirely would cause commands/scripts to fail if they
set it.)
---
lib/commands/toolcontext.c | 1 -
lib/commands/toolcontext.h | 1 -
lib/metadata/metadata.c | 5 +--
.../lvm2_activation_generator_systemd_red_hat.c | 2 +-
scripts/lvm2_monitoring_systemd_red_hat.service.in | 4 +-
tools/args.h | 3 +-
tools/command-lines.in | 45 +++++++++++++-------
tools/lvmcmdline.c | 1 -
tools/toollib.c | 19 ++++----
9 files changed, 44 insertions(+), 37 deletions(-)
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index 723f882..50474c1 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -1762,7 +1762,6 @@ struct cmd_context *create_toolcontext(unsigned is_clvmd,
cmd->threaded = threaded ? 1 : 0;
cmd->handles_missing_pvs = 0;
cmd->handles_unknown_segments = 0;
- cmd->ignore_clustered_vgs = 0;
cmd->hosttags = 0;
dm_list_init(&cmd->arg_value_groups);
dm_list_init(&cmd->formats);
diff --git a/lib/commands/toolcontext.h b/lib/commands/toolcontext.h
index 9849e5f..2b730ea 100644
--- a/lib/commands/toolcontext.h
+++ b/lib/commands/toolcontext.h
@@ -144,7 +144,6 @@ struct cmd_context {
unsigned report_binary_values_as_numeric:1;
unsigned report_mark_hidden_devices:1;
unsigned metadata_read_only:1;
- unsigned ignore_clustered_vgs:1;
unsigned threaded:1; /* set if running within a thread e.g. clvmd */
unsigned unknown_system_id:1;
unsigned include_historical_lvs:1; /* also process/report/display historical LVs */
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 34b1ec7..0ff38a2 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -4698,10 +4698,7 @@ static int _access_vg_clustered(struct cmd_context *cmd, const struct volume_gro
return 1;
}
- if (!cmd->ignore_clustered_vgs)
- log_error("Skipping clustered volume group %s", vg->name);
- else
- log_verbose("Skipping clustered volume group %s", vg->name);
+ log_verbose("Skipping clustered VG %s.", vg->name);
return 0;
}
diff --git a/scripts/lvm2_activation_generator_systemd_red_hat.c b/scripts/lvm2_activation_generator_systemd_red_hat.c
index 7791e64..b3d18d2 100644
--- a/scripts/lvm2_activation_generator_systemd_red_hat.c
+++ b/scripts/lvm2_activation_generator_systemd_red_hat.c
@@ -175,7 +175,7 @@ static int generate_unit(struct generator *gen, int unit)
"Wants=systemd-udev-settle.service\n\n" "[Service]\n", f);
}
- fputs("ExecStart=" LVM_PATH " vgchange -aay --ignoreskippedcluster", f);
+ fputs("ExecStart=" LVM_PATH " vgchange -aay", f);
if (gen->cfg.sysinit_needed)
fputs(" --sysinit", f);
fputs("\nType=oneshot\n", f);
diff --git a/scripts/lvm2_monitoring_systemd_red_hat.service.in b/scripts/lvm2_monitoring_systemd_red_hat.service.in
index ebc069e..4144862 100644
--- a/scripts/lvm2_monitoring_systemd_red_hat.service.in
+++ b/scripts/lvm2_monitoring_systemd_red_hat.service.in
@@ -10,8 +10,8 @@ Conflicts=shutdown.target
[Service]
Type=oneshot
Environment=LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES=1
-ExecStart=@SBINDIR@/lvm vgchange --monitor y --ignoreskippedcluster
-ExecStop=@SBINDIR@/lvm vgchange --monitor n --ignoreskippedcluster
+ExecStart=@SBINDIR@/lvm vgchange --monitor y
+ExecStop=@SBINDIR@/lvm vgchange --monitor n
RemainAfterExit=yes
[Install]
diff --git a/tools/args.h b/tools/args.h
index 2434f4b..e574bc7 100644
--- a/tools/args.h
+++ b/tools/args.h
@@ -243,8 +243,7 @@ arg(ignoremonitoring_ARG, '\0', "ignoremonitoring", 0, 0, 0,
"Do not use this if dmeventd is already monitoring a device.\n")
arg(ignoreskippedcluster_ARG, '\0', "ignoreskippedcluster", 0, 0, 0,
- "Use to avoid exiting with an non-zero status code if the command is run\n"
- "without clustered locking and clustered VGs are skipped.\n")
+ "No longer used.\n")
arg(ignoreunsupported_ARG, '\0', "ignoreunsupported", 0, 0, 0,
"Exclude unsupported configuration settings from the output. These settings are\n"
diff --git a/tools/command-lines.in b/tools/command-lines.in
index 0f9ed47..0155b33 100644
--- a/tools/command-lines.in
+++ b/tools/command-lines.in
@@ -194,7 +194,7 @@ OO_ALL: --commandprofile String, --config String, --debug,
# options for pvs, lvs, vgs, fullreport
#
OO_REPORT: --aligned, --all, --binary, --configreport ConfigReport, --foreign,
---ignorelockingfailure, --ignoreskippedcluster, --logonly,
+--ignorelockingfailure, --logonly,
--nameprefixes, --noheadings, --nosuffix,
--options String, --readonly, --reportformat ReportFmt, --rows,
--select String, --separator String, --shared, --sort String,
@@ -213,8 +213,7 @@ OO_CONFIG: --atversion String, --typeconfig ConfigType, --file String, --ignorea
# None of these can function as a required option for lvchange.
OO_LVCHANGE: --autobackup Bool, --force, --ignoremonitoring,
---ignoreskippedcluster, --noudevsync, --reportformat ReportFmt,
---select String
+--noudevsync, --reportformat ReportFmt, --select String
# Any of these can function as a required option for lvchange.
# profile is also part of OO_ALL, but is repeated in OO_LVCHANGE_META
@@ -235,6 +234,7 @@ OO_LVCHANGE_META: --addtag Tag, --deltag Tag,
lvchange OO_LVCHANGE_META VG|LV|Tag|Select ...
OO: --activate Active, --poll Bool, --monitor Bool, OO_LVCHANGE
+IO: --ignoreskippedcluster
ID: lvchange_properties
DESC: Change a general LV attribute.
DESC: For options listed in parentheses, any one is
@@ -257,6 +257,7 @@ RULE: --alloc --discards --zero --cachemode --cachepolicy --cachesettings not lv
lvchange --resync VG|LV_raid_mirror|Tag|Select ...
OO: --activate Active, OO_LVCHANGE
+IO: --ignoreskippedcluster
ID: lvchange_resync
DESC: Resyncronize a mirror or raid LV.
RULE: all not lv_is_pvmove lv_is_locked
@@ -264,12 +265,14 @@ RULE: all not LV_raid0
lvchange --syncaction SyncAction VG|LV_raid|Tag|Select ...
OO: OO_LVCHANGE
+IO: --ignoreskippedcluster
ID: lvchange_syncaction
DESC: Resynchronize or check a raid LV.
RULE: all not LV_raid0
lvchange --rebuild PV VG|LV_raid|Tag|Select ...
OO: OO_LVCHANGE
+IO: --ignoreskippedcluster
ID: lvchange_rebuild
DESC: Reconstruct data on specific PVs of a raid LV.
RULE: all not LV_raid0
@@ -277,27 +280,32 @@ RULE: all not LV_raid0
lvchange --activate Active VG|LV|Tag|Select ...
OO: --activationmode ActivationMode, --partial, --poll Bool, --monitor Bool,
--ignoreactivationskip, --ignorelockingfailure, --sysinit, OO_LVCHANGE
+IO: --ignoreskippedcluster
ID: lvchange_activate
DESC: Activate or deactivate an LV.
lvchange --refresh VG|LV|Tag|Select ...
OO: --activationmode ActivationMode, --partial, --poll Bool, --monitor Bool, OO_LVCHANGE
+IO: --ignoreskippedcluster
ID: lvchange_refresh
DESC: Reactivate an LV using the latest metadata.
lvchange --monitor Bool VG|LV|Tag|Select ...
OO: OO_LVCHANGE
+IO: --ignoreskippedcluster
ID: lvchange_monitor
DESC: Start or stop monitoring an LV from dmeventd.
RULE: all not lv_is_pvmove
lvchange --poll Bool VG|LV|Tag|Select ...
OO: --monitor Bool, OO_LVCHANGE
+IO: --ignoreskippedcluster
ID: lvchange_poll
DESC: Start or stop processing an LV conversion.
lvchange --persistent y --minor Number LV
OO: --major Number, --activate Active, --poll Bool, --monitor Bool, OO_LVCHANGE
+IO: --ignoreskippedcluster
ID: lvchange_persistent
DESC: Make the minor device number persistent for an LV.
RULE: all not LV_thinpool LV_cachepool
@@ -1193,12 +1201,12 @@ FLAGS: SECONDARY_SYNTAX
lvdisplay
OO: --aligned, --all, --binary, --colon, --columns,
--configreport ConfigReport, --foreign, --history, --ignorelockingfailure,
---ignoreskippedcluster, --logonly, --maps, --noheadings,
+--logonly, --maps, --noheadings,
--nosuffix, --options String, --sort String, --readonly,
--reportformat ReportFmt, --segments, --select String, --separator String,
--shared, --unbuffered, --units Units
OP: VG|LV|Tag ...
-IO: --partial
+IO: --partial, --ignoreskippedcluster
ID: lvdisplay_general
---
@@ -1312,7 +1320,7 @@ DESC: Resize a pool metadata SubLV by a specified size.
lvs
OO: --history, --segments, OO_REPORT
OP: VG|LV|Tag ...
-IO: --partial
+IO: --partial, --ignoreskippedcluster
ID: lvs_general
---
@@ -1333,8 +1341,7 @@ ID: lvscan_cache
---
# None of these can function as a required option for pvchange.
-OO_PVCHANGE: --autobackup Bool, --force, --ignoreskippedcluster,
---reportformat ReportFmt, --uuid
+OO_PVCHANGE: --autobackup Bool, --force, --reportformat ReportFmt, --uuid
# Any of these can function as a required option for pvchange.
OO_PVCHANGE_META: --allocatable Bool, --addtag Tag, --deltag Tag,
@@ -1342,11 +1349,13 @@ OO_PVCHANGE_META: --allocatable Bool, --addtag Tag, --deltag Tag,
pvchange OO_PVCHANGE_META --all
OO: OO_PVCHANGE
+IO: --ignoreskippedcluster
ID: pvchange_properties_all
DESC: Change properties of all PVs.
pvchange OO_PVCHANGE_META PV|Select ...
OO: --select String, OO_PVCHANGE
+IO: --ignoreskippedcluster
ID: pvchange_properties_some
DESC: Change properties of specified PVs.
@@ -1381,11 +1390,12 @@ RULE: --bootloaderareasize not --restorefile
pvdisplay
OO: --aligned, --all, --binary, --colon, --columns, --configreport ConfigReport,
---foreign, --ignorelockingfailure, --ignoreskippedcluster,
+--foreign, --ignorelockingfailure,
--logonly, --maps, --noheadings, --nosuffix, --options String,
--readonly, --reportformat ReportFmt, --select String, --separator String, --shared,
--short, --sort String, --unbuffered, --units Units
OP: PV|Tag ...
+IO: --ignoreskippedcluster
ID: pvdisplay_general
---
@@ -1413,7 +1423,7 @@ ID: pvremove_general
pvs
OO: --segments, OO_REPORT
OP: PV|Tag ...
-IO: --partial
+IO: --partial, --ignoreskippedcluster
ID: pvs_general
---
@@ -1473,7 +1483,7 @@ DESC: List one VG metadata backup file.
# None of these can function as a required option for vgchange.
-OO_VGCHANGE: --autobackup Bool, --ignoremonitoring, --ignoreskippedcluster,
+OO_VGCHANGE: --autobackup Bool, --ignoremonitoring,
--noudevsync, --reportformat ReportFmt, --select String, --force
# Any of these can function as a required option for vgchange.
@@ -1489,6 +1499,7 @@ OO_VGCHANGE_META: --addtag Tag, --deltag Tag,
vgchange OO_VGCHANGE_META
OO: --poll Bool, OO_VGCHANGE
OP: VG|Tag|Select ...
+IO: --ignoreskippedcluster
ID: vgchange_properties
DESC: Change a general VG attribute.
DESC: For options listed in parentheses, any one is
@@ -1497,12 +1508,14 @@ DESC: required, after which the others are optional.
vgchange --monitor Bool
OO: --sysinit, --ignorelockingfailure, --poll Bool, OO_VGCHANGE
OP: VG|Tag|Select ...
+IO: --ignoreskippedcluster
ID: vgchange_monitor
DESC: Start or stop monitoring LVs from dmeventd.
vgchange --poll Bool
OO: --ignorelockingfailure, OO_VGCHANGE
OP: VG|Tag|Select ...
+IO: --ignoreskippedcluster
ID: vgchange_poll
DESC: Start or stop processing LV conversions.
@@ -1510,12 +1523,14 @@ vgchange --activate Active
OO: --activationmode ActivationMode, --ignoreactivationskip, --partial, --sysinit,
--ignorelockingfailure, --monitor Bool, --poll Bool, OO_VGCHANGE
OP: VG|Tag|Select ...
+IO: --ignoreskippedcluster
ID: vgchange_activate
DESC: Activate or deactivate LVs.
vgchange --refresh
OO: --sysinit, --ignorelockingfailure, --poll Bool, OO_VGCHANGE
OP: VG|Tag|Select ...
+IO: --ignoreskippedcluster
ID: vgchange_refresh
DESC: Reactivate LVs using the latest metadata.
@@ -1562,11 +1577,11 @@ ID: vgcreate_general
vgdisplay
OO: --activevolumegroups, --aligned, --binary, --colon, --columns,
--configreport ConfigReport, --foreign, --ignorelockingfailure,
---ignoreskippedcluster, --logonly, --noheadings, --nosuffix,
+--logonly, --noheadings, --nosuffix,
--options String, --readonly, --reportformat ReportFmt, --select String,
--shared, --short, --separator String, --sort String, --unbuffered, --units Units
OP: VG|Tag ...
-IO: --partial
+IO: --partial, --ignoreskippedcluster
ID: vgdisplay_general
---
@@ -1668,7 +1683,7 @@ DESC: Rename a VG by specifying the VG UUID.
vgs
OO: OO_REPORT
OP: VG|Tag ...
-IO: --partial
+IO: --partial, --ignoreskippedcluster
ID: vgs_general
---
@@ -1723,7 +1738,7 @@ ID: devtypes_general
fullreport
OO: OO_REPORT
OP: VG ...
-IO: --partial
+IO: --partial, --ignoreskippedcluster
ID: fullreport_general
lastlog
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 2578113..3e617c1 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -2323,7 +2323,6 @@ static int _get_current_settings(struct cmd_context *cmd)
return EINVALID_CMD_LINE;
}
- cmd->ignore_clustered_vgs = arg_is_set(cmd, ignoreskippedcluster_ARG);
cmd->include_foreign_vgs = arg_is_set(cmd, foreign_ARG) ? 1 : 0;
cmd->include_shared_vgs = arg_is_set(cmd, shared_ARG) ? 1 : 0;
cmd->include_historical_lvs = arg_is_set(cmd, history_ARG) ? 1 : 0;
diff --git a/tools/toollib.c b/tools/toollib.c
index c81d1c2..ebf2509 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -204,10 +204,15 @@ static int _ignore_vg(struct volume_group *vg, const char *vg_name,
if ((read_error & FAILED_INCONSISTENT) && (read_flags & READ_ALLOW_INCONSISTENT))
read_error &= ~FAILED_INCONSISTENT; /* Check for other errors */
- if ((read_error & FAILED_CLUSTERED) && vg->cmd->ignore_clustered_vgs) {
- read_error &= ~FAILED_CLUSTERED; /* Check for other errors */
- log_verbose("Skipping volume group %s", vg_name);
- *skip = 1;
+ if (read_error & FAILED_CLUSTERED) {
+ if (arg_vgnames && str_list_match_item(arg_vgnames, vg->name)) {
+ log_error("Cannot access clustered VG %s, see lvmlockd(8).", vg->name);
+ return 1;
+ } else {
+ log_warn("Skipping clustered VG %s.", vg_name);
+ *skip = 1;
+ return 0;
+ }
}
/*
@@ -254,12 +259,6 @@ static int _ignore_vg(struct volume_group *vg, const char *vg_name,
}
}
- if (read_error == FAILED_CLUSTERED) {
- *skip = 1;
- stack; /* Error already logged */
- return 1;
- }
-
if (read_error != SUCCESS) {
*skip = 0;
if (is_orphan_vg(vg_name))
6 years
master - report: show empty lock_type for none
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=ccab4a1994f4218810f...
Commit: ccab4a1994f4218810f1a6152cf6c71caa00977e
Parent: 328303d4d45b4e9480cc806ef84e843e2176f584
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Jun 15 14:14:39 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Jun 15 14:14:39 2018 -0500
report: show empty lock_type for none
Sometimes lock_type would be displayed as "none"
(after changing it) and sometimes as empty.
Make it consistently empty.
---
lib/report/report.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/lib/report/report.c b/lib/report/report.c
index 8039820..369f47c 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -2855,8 +2855,14 @@ static int _vglocktype_disp(struct dm_report *rh, struct dm_pool *mem,
const void *data, void *private)
{
const struct volume_group *vg = (const struct volume_group *) data;
+ const char *locktype;
- return _field_string(rh, field, vg->lock_type ? : "");
+ if (!vg->lock_type || !strcmp(vg->lock_type, "none"))
+ locktype = "";
+ else
+ locktype = vg->lock_type;
+
+ return _field_string(rh, field, locktype);
}
static int _vglockargs_disp(struct dm_report *rh, struct dm_pool *mem,
6 years
master - Remove unused device error counting
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=328303d4d45b4e9480c...
Commit: 328303d4d45b4e9480cc806ef84e843e2176f584
Parent: 54f61e7dccf82471dd4a963bfcbcf14802806ca9
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Jun 15 14:04:39 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Jun 15 14:04:39 2018 -0500
Remove unused device error counting
---
lib/commands/toolcontext.c | 3 ---
lib/config/config_settings.h | 8 ++------
lib/config/defaults.h | 3 ---
lib/device/dev-cache.c | 19 +++----------------
lib/device/dev-io.c | 24 ------------------------
lib/device/device.h | 2 --
lib/misc/lvm-globals.c | 11 -----------
lib/misc/lvm-globals.h | 4 ----
8 files changed, 5 insertions(+), 69 deletions(-)
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index a76c68d..723f882 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -974,9 +974,6 @@ static int _init_dev_cache(struct cmd_context *cmd)
int len_diff;
int device_list_from_udev;
- init_dev_disable_after_error_count(
- find_config_tree_int(cmd, devices_disable_after_error_count_CFG, NULL));
-
if (!dev_cache_init(cmd))
return_0;
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index ff098d8..ac0f0ff 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -410,12 +410,8 @@ cfg(devices_ignore_lvm_mirrors_CFG, "ignore_lvm_mirrors", devices_CFG_SECTION, 0
"apply to LVM RAID types like 'raid1' which handle failures in a\n"
"different way, making them a better choice for VG stacking.\n")
-cfg(devices_disable_after_error_count_CFG, "disable_after_error_count", devices_CFG_SECTION, 0, CFG_TYPE_INT, DEFAULT_DISABLE_AFTER_ERROR_COUNT, vsn(2, 2, 75), NULL, 0, NULL,
- "Number of I/O errors after which a device is skipped.\n"
- "During each LVM operation, errors received from each device are\n"
- "counted. If the counter of a device exceeds the limit set here,\n"
- "no further I/O is sent to that device for the remainder of the\n"
- "operation. Setting this to 0 disables the counters altogether.\n")
+cfg(devices_disable_after_error_count_CFG, "disable_after_error_count", devices_CFG_SECTION, 0, CFG_TYPE_INT, 0, vsn(2, 2, 75), NULL, vsn(3, 0, 0), NULL,
+ "This setting is no longer used.\n")
cfg(devices_require_restorefile_with_uuid_CFG, "require_restorefile_with_uuid", devices_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_REQUIRE_RESTOREFILE_WITH_UUID, vsn(2, 2, 73), NULL, 0, NULL,
"Allow use of pvcreate --uuid without requiring --restorefile.\n")
diff --git a/lib/config/defaults.h b/lib/config/defaults.h
index 7cebd84..084d365 100644
--- a/lib/config/defaults.h
+++ b/lib/config/defaults.h
@@ -39,7 +39,6 @@
#define DEFAULT_IGNORE_LVM_MIRRORS 1
#define DEFAULT_MULTIPATH_COMPONENT_DETECTION 1
#define DEFAULT_IGNORE_SUSPENDED_DEVICES 0
-#define DEFAULT_DISABLE_AFTER_ERROR_COUNT 0
#define DEFAULT_REQUIRE_RESTOREFILE_WITH_UUID 1
#define DEFAULT_DATA_ALIGNMENT_OFFSET_DETECTION 1
#define DEFAULT_DATA_ALIGNMENT_DETECTION 1
@@ -206,8 +205,6 @@
#define DEFAULT_MAX_HISTORY 100
-#define DEFAULT_MAX_ERROR_COUNT NO_DEV_ERROR_COUNT_LIMIT
-
#define DEFAULT_REP_COMPACT_OUTPUT 0
#define DEFAULT_REP_ALIGNED 1
#define DEFAULT_REP_BUFFERED 1
diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index 1635c99..a0d98a3 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -62,13 +62,12 @@ static int _insert(const char *path, const struct stat *info,
int rec, int check_with_udev_db);
/* Setup non-zero members of passed zeroed 'struct device' */
-static void _dev_init(struct device *dev, int max_error_count)
+static void _dev_init(struct device *dev)
{
dev->phys_block_size = -1;
dev->block_size = -1;
dev->fd = -1;
dev->read_ahead = -1;
- dev->max_error_count = max_error_count;
dev->ext.enabled = 0;
dev->ext.src = DEV_EXT_NONE;
@@ -129,7 +128,7 @@ struct device *dev_create_file(const char *filename, struct device *dev,
return NULL;
}
- _dev_init(dev, NO_DEV_ERROR_COUNT_LIMIT);
+ _dev_init(dev);
dev->flags = DEV_REGULAR | ((use_malloc) ? DEV_ALLOCED : 0);
dm_list_add(&dev->aliases, &alias->list);
@@ -145,7 +144,7 @@ static struct device *_dev_create(dev_t d)
return NULL;
}
- _dev_init(dev, dev_disable_after_error_count());
+ _dev_init(dev);
dev->dev = d;
return dev;
@@ -1690,18 +1689,6 @@ struct device *dev_iter_get(struct cmd_context *cmd, struct dev_iter *iter)
return NULL;
}
-void dev_reset_error_count(struct cmd_context *cmd)
-{
- struct dev_iter iter;
-
- if (!_cache.devices)
- return;
-
- iter.current = btree_first(_cache.devices);
- while (iter.current)
- _iter_next(&iter)->error_count = 0;
-}
-
int dev_fd(struct device *dev)
{
return dev->fd;
diff --git a/lib/device/dev-io.c b/lib/device/dev-io.c
index ffdf75e..43c2c2d 100644
--- a/lib/device/dev-io.c
+++ b/lib/device/dev-io.c
@@ -689,20 +689,6 @@ int dev_close_immediate(struct device *dev)
return _dev_close(dev, 1);
}
-static inline int _dev_is_valid(struct device *dev)
-{
- return (dev->max_error_count == NO_DEV_ERROR_COUNT_LIMIT ||
- dev->error_count < dev->max_error_count);
-}
-
-static void _dev_inc_error_count(struct device *dev)
-{
- if (++dev->error_count == dev->max_error_count)
- log_warn("WARNING: Error counts reached a limit of %d. "
- "Device %s was disabled",
- dev->max_error_count, dev_name(dev));
-}
-
int dev_read(struct device *dev, uint64_t offset, size_t len, dev_io_reason_t reason, void *buffer)
{
struct device_area where;
@@ -711,16 +697,11 @@ int dev_read(struct device *dev, uint64_t offset, size_t len, dev_io_reason_t re
if (!dev->open_count)
return_0;
- if (!_dev_is_valid(dev))
- return 0;
-
where.dev = dev;
where.start = offset;
where.size = len;
ret = _aligned_io(&where, buffer, 0, reason);
- if (!ret)
- _dev_inc_error_count(dev);
return ret;
}
@@ -783,9 +764,6 @@ int dev_write(struct device *dev, uint64_t offset, size_t len, dev_io_reason_t r
if (!dev->open_count)
return_0;
- if (!_dev_is_valid(dev))
- return 0;
-
if (!len) {
log_error(INTERNAL_ERROR "Attempted to write 0 bytes to %s at " FMTu64, dev_name(dev), offset);
return 0;
@@ -798,8 +776,6 @@ int dev_write(struct device *dev, uint64_t offset, size_t len, dev_io_reason_t r
dev->flags |= DEV_ACCESSED_W;
ret = _aligned_io(&where, buffer, 1, reason);
- if (!ret)
- _dev_inc_error_count(dev);
return ret;
}
diff --git a/lib/device/device.h b/lib/device/device.h
index 8f9ed55..00e398a 100644
--- a/lib/device/device.h
+++ b/lib/device/device.h
@@ -64,8 +64,6 @@ struct device {
/* private */
int fd;
int open_count;
- int error_count;
- int max_error_count;
int phys_block_size;
int block_size;
int read_ahead;
diff --git a/lib/misc/lvm-globals.c b/lib/misc/lvm-globals.c
index 9377588..86e6cf4 100644
--- a/lib/misc/lvm-globals.c
+++ b/lib/misc/lvm-globals.c
@@ -49,7 +49,6 @@ static int _udev_checking = 1;
static int _retry_deactivation = DEFAULT_RETRY_DEACTIVATION;
static int _activation_checks = 0;
static char _sysfs_dir_path[PATH_MAX] = "";
-static int _dev_disable_after_error_count = DEFAULT_DISABLE_AFTER_ERROR_COUNT;
static uint64_t _pv_min_size = (DEFAULT_PV_MIN_SIZE_KB * 1024L >> SECTOR_SHIFT);
static const char *_unknown_device_name = DEFAULT_UNKNOWN_DEVICE_NAME;
@@ -173,11 +172,6 @@ void init_activation_checks(int checks)
log_debug_activation("LVM activation checks disabled");
}
-void init_dev_disable_after_error_count(int value)
-{
- _dev_disable_after_error_count = value;
-}
-
void init_pv_min_size(uint64_t sectors)
{
_pv_min_size = sectors;
@@ -345,11 +339,6 @@ const char *sysfs_dir_path(void)
return _sysfs_dir_path;
}
-int dev_disable_after_error_count(void)
-{
- return _dev_disable_after_error_count;
-}
-
uint64_t pv_min_size(void)
{
return _pv_min_size;
diff --git a/lib/misc/lvm-globals.h b/lib/misc/lvm-globals.h
index 55a9399..6fc26cc 100644
--- a/lib/misc/lvm-globals.h
+++ b/lib/misc/lvm-globals.h
@@ -45,7 +45,6 @@ void init_ignore_lvm_mirrors(int scan);
void init_error_message_produced(int produced);
void init_is_static(unsigned value);
void init_udev_checking(int checking);
-void init_dev_disable_after_error_count(int value);
void init_pv_min_size(uint64_t sectors);
void init_activation_checks(int checks);
void init_retry_deactivation(int retry);
@@ -84,7 +83,4 @@ const char *unknown_device_name(void);
#define DMEVENTD_MONITOR_IGNORE -1
int dmeventd_monitor_mode(void);
-#define NO_DEV_ERROR_COUNT_LIMIT 0
-int dev_disable_after_error_count(void);
-
#endif
6 years
master - config: add deprecated version for recently removed settings
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=54f61e7dccf82471dd4...
Commit: 54f61e7dccf82471dd4a963bfcbcf14802806ca9
Parent: 3fd75d1bcd714b02fb2b843d1928b2a875402f37
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Jun 15 13:56:26 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Jun 15 13:56:26 2018 -0500
config: add deprecated version for recently removed settings
assumes that the next version from this branch is 3.0.0
---
lib/config/config_settings.h | 32 ++++++++++++++++----------------
1 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index a730afb..ff098d8 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -315,13 +315,13 @@ cfg_array(devices_global_filter_CFG, "global_filter", devices_CFG_SECTION, CFG_D
cfg_runtime(devices_cache_CFG, "cache", devices_CFG_SECTION, 0, CFG_TYPE_STRING, vsn(1, 0, 0), vsn(1, 2, 19), NULL,
"This setting is no longer used.\n")
-cfg_runtime(devices_cache_dir_CFG, "cache_dir", devices_CFG_SECTION, 0, CFG_TYPE_STRING, vsn(1, 2, 19), 0, NULL,
+cfg_runtime(devices_cache_dir_CFG, "cache_dir", devices_CFG_SECTION, 0, CFG_TYPE_STRING, vsn(1, 2, 19), vsn(3, 0, 0), NULL,
"This setting is no longer used.\n")
-cfg(devices_cache_file_prefix_CFG, "cache_file_prefix", devices_CFG_SECTION, CFG_ALLOW_EMPTY, CFG_TYPE_STRING, DEFAULT_CACHE_FILE_PREFIX, vsn(1, 2, 19), NULL, 0, NULL,
+cfg(devices_cache_file_prefix_CFG, "cache_file_prefix", devices_CFG_SECTION, CFG_ALLOW_EMPTY, CFG_TYPE_STRING, DEFAULT_CACHE_FILE_PREFIX, vsn(1, 2, 19), NULL, vsn(3, 0, 0), NULL,
"This setting is no longer used.\n")
-cfg(devices_write_cache_state_CFG, "write_cache_state", devices_CFG_SECTION, 0, CFG_TYPE_BOOL, 1, vsn(1, 0, 0), NULL, 0, NULL,
+cfg(devices_write_cache_state_CFG, "write_cache_state", devices_CFG_SECTION, 0, CFG_TYPE_BOOL, 1, vsn(1, 0, 0), NULL, vsn(3, 0, 0), NULL,
"This setting is no longer used.\n")
cfg_array(devices_types_CFG, "types", devices_CFG_SECTION, CFG_DEFAULT_UNDEFINED | CFG_ADVANCED, CFG_TYPE_INT | CFG_TYPE_STRING, NULL, vsn(1, 0, 0), NULL, 0, NULL,
@@ -760,13 +760,13 @@ cfg(global_activation_CFG, "activation", global_CFG_SECTION, 0, CFG_TYPE_BOOL, D
"is not present in the kernel, disabling this should suppress\n"
"the error messages.\n")
-cfg(global_fallback_to_lvm1_CFG, "fallback_to_lvm1", global_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, 0, vsn(1, 0, 18), NULL, 0, NULL,
+cfg(global_fallback_to_lvm1_CFG, "fallback_to_lvm1", global_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, 0, vsn(1, 0, 18), NULL, vsn(3, 0, 0), NULL,
"This setting is no longer used.\n")
-cfg(global_format_CFG, "format", global_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_FORMAT, vsn(1, 0, 0), NULL, 0, NULL,
+cfg(global_format_CFG, "format", global_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_FORMAT, vsn(1, 0, 0), NULL, vsn(3, 0, 0), NULL,
"This setting is no longer used.\n")
-cfg_array(global_format_libraries_CFG, "format_libraries", global_CFG_SECTION, CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(1, 0, 0), NULL, 0, NULL,
+cfg_array(global_format_libraries_CFG, "format_libraries", global_CFG_SECTION, CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(1, 0, 0), NULL, vsn(3, 0, 0), NULL,
"This setting is no longer used.")
cfg_array(global_segment_libraries_CFG, "segment_libraries", global_CFG_SECTION, CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(1, 0, 18), NULL, 0, NULL, NULL)
@@ -777,16 +777,16 @@ cfg(global_proc_CFG, "proc", global_CFG_SECTION, CFG_ADVANCED, CFG_TYPE_STRING,
cfg(global_etc_CFG, "etc", global_CFG_SECTION, 0, CFG_TYPE_STRING, DEFAULT_ETC_DIR, vsn(2, 2, 117), "@CONFDIR@", 0, NULL,
"Location of /etc system configuration directory.\n")
-cfg(global_locking_type_CFG, "locking_type", global_CFG_SECTION, 0, CFG_TYPE_INT, 1, vsn(1, 0, 0), NULL, 0, NULL,
+cfg(global_locking_type_CFG, "locking_type", global_CFG_SECTION, 0, CFG_TYPE_INT, 1, vsn(1, 0, 0), NULL, vsn(3, 0, 0), NULL,
"This setting is no longer used.")
cfg(global_wait_for_locks_CFG, "wait_for_locks", global_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_WAIT_FOR_LOCKS, vsn(2, 2, 50), NULL, 0, NULL,
"When disabled, fail if a lock request would block.\n")
-cfg(global_fallback_to_clustered_locking_CFG, "fallback_to_clustered_locking", global_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_FALLBACK_TO_CLUSTERED_LOCKING, vsn(2, 2, 42), NULL, 0, NULL,
+cfg(global_fallback_to_clustered_locking_CFG, "fallback_to_clustered_locking", global_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_FALLBACK_TO_CLUSTERED_LOCKING, vsn(2, 2, 42), NULL, vsn(3, 0, 0), NULL,
"This setting is no longer used.\n")
-cfg(global_fallback_to_local_locking_CFG, "fallback_to_local_locking", global_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_FALLBACK_TO_LOCAL_LOCKING, vsn(2, 2, 42), NULL, 0, NULL,
+cfg(global_fallback_to_local_locking_CFG, "fallback_to_local_locking", global_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_FALLBACK_TO_LOCAL_LOCKING, vsn(2, 2, 42), NULL, vsn(3, 0, 0), NULL,
"This setting is no longer used.\n")
cfg(global_locking_dir_CFG, "locking_dir", global_CFG_SECTION, 0, CFG_TYPE_STRING, DEFAULT_LOCK_DIR, vsn(1, 0, 0), "@DEFAULT_LOCK_DIR@", 0, NULL,
@@ -806,7 +806,7 @@ cfg(global_prioritise_write_locks_CFG, "prioritise_write_locks", global_CFG_SECT
cfg(global_library_dir_CFG, "library_dir", global_CFG_SECTION, CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(1, 0, 0), NULL, 0, NULL,
"Search this directory first for shared libraries.\n")
-cfg(global_locking_library_CFG, "locking_library", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_LOCKING_LIB, vsn(1, 0, 0), NULL, 0, NULL,
+cfg(global_locking_library_CFG, "locking_library", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_LOCKING_LIB, vsn(1, 0, 0), NULL, vsn(3, 0, 0), NULL,
"This setting is no longer used.\n")
cfg(global_abort_on_internal_errors_CFG, "abort_on_internal_errors", global_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_ABORT_ON_INTERNAL_ERRORS, vsn(2, 2, 57), NULL, 0, NULL,
@@ -1501,14 +1501,14 @@ cfg(metadata_pvmetadataignore_CFG, "pvmetadataignore", metadata_CFG_SECTION, CFG
cfg(metadata_stripesize_CFG, "stripesize", metadata_CFG_SECTION, CFG_ADVANCED | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_STRIPESIZE, vsn(1, 0, 0), NULL, 0, NULL, NULL)
-cfg_array(metadata_dirs_CFG, "dirs", metadata_CFG_SECTION, CFG_ADVANCED | CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(1, 0, 0), NULL, 0, NULL,
+cfg_array(metadata_dirs_CFG, "dirs", metadata_CFG_SECTION, CFG_ADVANCED | CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(1, 0, 0), NULL, vsn(3, 0, 0), NULL,
"This setting is no longer used.\n")
-cfg_section(metadata_disk_areas_CFG_SUBSECTION, "disk_areas", metadata_CFG_SECTION, CFG_UNSUPPORTED | CFG_DEFAULT_COMMENTED, vsn(1, 0, 0), 0, NULL, NULL)
-cfg_section(disk_area_CFG_SUBSECTION, "disk_area", metadata_disk_areas_CFG_SUBSECTION, CFG_NAME_VARIABLE | CFG_UNSUPPORTED | CFG_DEFAULT_COMMENTED, vsn(1, 0, 0), 0, NULL, NULL)
-cfg(disk_area_start_sector_CFG, "start_sector", disk_area_CFG_SUBSECTION, CFG_UNSUPPORTED | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, 0, vsn(1, 0, 0), NULL, 0, NULL, NULL)
-cfg(disk_area_size_CFG, "size", disk_area_CFG_SUBSECTION, CFG_UNSUPPORTED | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, 0, vsn(1, 0, 0), NULL, 0, NULL, NULL)
-cfg(disk_area_id_CFG, "id", disk_area_CFG_SUBSECTION, CFG_UNSUPPORTED | CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(1, 0, 0), NULL, 0, NULL, NULL)
+cfg_section(metadata_disk_areas_CFG_SUBSECTION, "disk_areas", metadata_CFG_SECTION, CFG_UNSUPPORTED | CFG_DEFAULT_COMMENTED, vsn(1, 0, 0), vsn(3, 0, 0), NULL, NULL)
+cfg_section(disk_area_CFG_SUBSECTION, "disk_area", metadata_disk_areas_CFG_SUBSECTION, CFG_NAME_VARIABLE | CFG_UNSUPPORTED | CFG_DEFAULT_COMMENTED, vsn(1, 0, 0), vsn(3, 0, 0), NULL, NULL)
+cfg(disk_area_start_sector_CFG, "start_sector", disk_area_CFG_SUBSECTION, CFG_UNSUPPORTED | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, 0, vsn(1, 0, 0), NULL, vsn(3, 0, 0), NULL, NULL)
+cfg(disk_area_size_CFG, "size", disk_area_CFG_SUBSECTION, CFG_UNSUPPORTED | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, 0, vsn(1, 0, 0), NULL, vsn(3, 0, 0), NULL, NULL)
+cfg(disk_area_id_CFG, "id", disk_area_CFG_SUBSECTION, CFG_UNSUPPORTED | CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(1, 0, 0), NULL, vsn(3, 0, 0), NULL, NULL)
cfg(report_output_format_CFG, "output_format", report_CFG_SECTION, CFG_PROFILABLE | CFG_DEFAULT_COMMENTED | CFG_DISALLOW_INTERACTIVE, CFG_TYPE_STRING, DEFAULT_REP_OUTPUT_FORMAT, vsn(2, 2, 158), NULL, 0, NULL,
"Format of LVM command's report output.\n"
6 years
master - scan: use full md filter when md 1.0 devices are present
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3fd75d1bcd714b02fb2...
Commit: 3fd75d1bcd714b02fb2b843d1928b2a875402f37
Parent: 8eab37593eccbbb8c6d03a9bae2f6852c17a00a5
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Jun 15 11:42:10 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Jun 15 12:21:25 2018 -0500
scan: use full md filter when md 1.0 devices are present
The md filter can operate in two native modes:
- normal: reads only the start of each device
- full: reads both the start and end of each device
md 1.0 devices place the superblock at the end of the device,
so components of this version will only be identified and
excluded when lvm uses the full md filter.
Previously, the full md filter was only used in commands
that could write to the device. Now, the full md filter
is also applied when there is an md 1.0 device present
on the system. This means the 'pvs' command can avoid
displaying md 1.0 components (at the cost of doubling
the i/o to every device on the system.)
(The md filter can operate in a third mode, using udev,
but this is disabled by default because there have been
problems with reliability of the info returned from udev.)
---
lib/cache/lvmcache.c | 2 +-
lib/device/dev-md.c | 27 +++++++++---
lib/device/dev-type.h | 1 +
lib/filters/filter-md.c | 81 ++++++++++++++++-------------------
lib/label/label.c | 14 ++++++
test/shell/pvcreate-md-fake-hdr.sh | 3 +-
6 files changed, 75 insertions(+), 53 deletions(-)
diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
index c7e3903..f15b352 100644
--- a/lib/cache/lvmcache.c
+++ b/lib/cache/lvmcache.c
@@ -452,7 +452,7 @@ int lvmcache_dev_is_unchosen_duplicate(struct device *dev)
* unused_duplicate_devs list, and restrict what we allow done with it.
*
* In the case of md components, we usually filter these out in filter-md,
- * but in the special case of md superblocks <= 1.0 where the superblock
+ * but in the special case of md superblock version 1.0 where the superblock
* is at the end of the device, filter-md doesn't always eliminate them
* first, so we eliminate them here.
*
diff --git a/lib/device/dev-md.c b/lib/device/dev-md.c
index 8284c4d..ac99f42 100644
--- a/lib/device/dev-md.c
+++ b/lib/device/dev-md.c
@@ -142,13 +142,6 @@ static int _native_dev_is_md(struct device *dev, uint64_t *offset_found, int ful
* command if it should do a full check (cmd->use_full_md_check),
* and set it for commands that could possibly write to an md dev
* (pvcreate/vgcreate/vgextend).
- *
- * For old md versions with magic numbers at the end of devices,
- * the md dev components won't be filtered out here when full is 0,
- * so they will be scanned, and appear as duplicate PVs in lvmcache.
- * The md device itself will be chosen as the primary duplicate,
- * and the components are dropped from the list of duplicates in,
- * i.e. a kind of post-scan filtering.
*/
if (!full) {
sb_offset = 0;
@@ -414,6 +407,26 @@ unsigned long dev_md_stripe_width(struct dev_types *dt, struct device *dev)
return stripe_width_sectors;
}
+int dev_is_md_with_end_superblock(struct dev_types *dt, struct device *dev)
+{
+ char version_string[MD_MAX_SYSFS_SIZE];
+ const char *attribute = "metadata_version";
+
+ if (MAJOR(dev->dev) != dt->md_major)
+ return 0;
+
+ if (_md_sysfs_attribute_scanf(dt, dev, attribute,
+ "%s", &version_string) != 1)
+ return -1;
+
+ log_very_verbose("Device %s %s is %s.",
+ dev_name(dev), attribute, version_string);
+
+ if (!strcmp(version_string, "1.0"))
+ return 1;
+ return 0;
+}
+
#else
int dev_is_md(struct device *dev __attribute__((unused)),
diff --git a/lib/device/dev-type.h b/lib/device/dev-type.h
index 210a316..0e418d6 100644
--- a/lib/device/dev-type.h
+++ b/lib/device/dev-type.h
@@ -76,6 +76,7 @@ int wipe_known_signatures(struct cmd_context *cmd, struct device *dev, const cha
/* Type-specific device properties */
unsigned long dev_md_stripe_width(struct dev_types *dt, struct device *dev);
+int dev_is_md_with_end_superblock(struct dev_types *dt, struct device *dev);
/* Partitioning */
int major_max_partitions(struct dev_types *dt, int major);
diff --git a/lib/filters/filter-md.c b/lib/filters/filter-md.c
index 95e0aad..4c3f23d 100644
--- a/lib/filters/filter-md.c
+++ b/lib/filters/filter-md.c
@@ -30,50 +30,43 @@
*
* (This is assuming lvm.conf md_component_detection=1.)
*
- * If lvm does *not* ignore the components, then lvm will read lvm
- * labels from the md dev and from the component devs, and will see
- * them all as duplicates of each other. LVM duplicate resolution
- * will then kick in and keep the md dev around to use and ignore
- * the components.
- *
- * It is better to exclude the components as early as possible during
- * lvm processing, ideally before lvm even looks for labels on the
- * components, so that duplicate resolution can be avoided. There are
- * a number of ways that md components can be excluded earlier than
- * the duplicate resolution phase:
- *
- * - When external_device_info_source="udev", lvm discovers a device is
- * an md component by asking udev during the initial filtering phase.
- * However, lvm's default is to not use udev for this. The
- * alternative is "native" detection in which lvm tries to detect
- * md components itself.
- *
- * - When using native detection, lvm's md filter looks for the md
- * superblock at the start of devices. It will see the md superblock
- * on the components, exclude them in the md filter, and avoid
- * handling them later in duplicate resolution.
- *
- * - When using native detection, lvm's md filter will not detect
- * components when the md device has an older superblock version that
- * places the superblock at the end of the device. This case will
- * fall back to duplicate resolution to exclude components.
- *
- * A variation of the description above occurs for lvm commands that
- * intend to create new PVs on devices (pvcreate, vgcreate, vgextend).
- * For these commands, the native md filter also reads the end of all
- * devices to check for the odd md superblocks.
- *
- * (The reason that external_device_info_source is not set to udev by
- * default is that there have be issues with udev not being promptly
- * or reliably updated about md state changes, causing the udev info
- * that lvm uses to be occasionally wrong.)
- */
-
-/*
- * FIXME: for commands that want a full md check (pvcreate, vgcreate,
- * vgextend), we do an extra read at the end of every device that the
- * filter looks at. This isn't necessary; we only need to do the full
- * md check on the PVs that these commands are trying to use.
+ * If lvm does *not* ignore the components, then lvm may read lvm
+ * labels from the component devs and potentially the md dev,
+ * which can trigger duplicate detection, and/or cause lvm to display
+ * md components as PVs rather than ignoring them.
+ *
+ * If scanning md componenents causes duplicates to be seen, then
+ * the lvm duplicate resolution will exclude the components.
+ *
+ * The lvm md filter has three modes:
+ *
+ * 1. look for md superblock at the start of the device
+ * 2. look for md superblock at the start and end of the device
+ * 3. use udev to detect components
+ *
+ * mode 1 will not detect and exclude components of md devices
+ * that use superblock version 1.0 which is at the end of the device.
+ *
+ * mode 2 will detect these, but mode 2 doubles the i/o done by label
+ * scan, since there's a read at both the start and end of every device.
+ *
+ * mode 3 is used when external_device_info_source="udev". It does
+ * not require any io from lvm, but this mode is not used by default
+ * because there have been problems getting reliable info from udev.
+ *
+ * lvm uses mode 2 when:
+ *
+ * - the command is pvcreate/vgcreate/vgextend, which format new
+ * devices, and if the user ran these commands on a component
+ * device of an md device 1.0, then it would cause problems.
+ * FIXME: this would only really need to scan the end of the
+ * devices being formatted, not all devices.
+ *
+ * - it sees an md device on the system using version 1.0.
+ * The point of this is just to avoid displaying md components
+ * from the 'pvs' command.
+ * FIXME: the cost (double i/o) may not be worth the benefit
+ * (not showing md components).
*/
/*
diff --git a/lib/label/label.c b/lib/label/label.c
index de5aa88..065c01f 100644
--- a/lib/label/label.c
+++ b/lib/label/label.c
@@ -847,6 +847,20 @@ int label_scan(struct cmd_context *cmd)
bcache_invalidate_fd(scan_bcache, dev->bcache_fd);
_scan_dev_close(dev);
}
+
+ /*
+ * When md devices exist that use the old superblock at the
+ * end of the device, then in order to detect and filter out
+ * the component devices of those md devs, we need to enable
+ * the full md filter which scans both the start and the end
+ * of every device. This doubles the amount of scanning i/o,
+ * which we want to avoid. FIXME: it may not be worth the
+ * cost of double i/o just to avoid displaying md component
+ * devs in 'pvs', which is a pretty harmless effect from a
+ * pretty uncommon situation.
+ */
+ if (dev_is_md_with_end_superblock(cmd->dev_types, dev))
+ cmd->use_full_md_check = 1;
};
dev_iter_destroy(iter);
diff --git a/test/shell/pvcreate-md-fake-hdr.sh b/test/shell/pvcreate-md-fake-hdr.sh
index 13d810c..82dd8d4 100644
--- a/test/shell/pvcreate-md-fake-hdr.sh
+++ b/test/shell/pvcreate-md-fake-hdr.sh
@@ -95,6 +95,7 @@ sleep 1
# (when mdadm supports repair)
if mdadm --action=repair "$mddev" ; then
sleep 1
+ pvscan -vvvv
# should be showing correctly PV3 & PV4
- pvs
+ pvs -vvvv "$dev3" "$dev4"
fi
6 years
master - Add cmd arg to more functions
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=8eab37593eccbbb8c6d...
Commit: 8eab37593eccbbb8c6d03a9bae2f6852c17a00a5
Parent: 27c647d6ce707326237771d3b046b6049161fb5a
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Jun 15 11:03:55 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Jun 15 11:03:55 2018 -0500
Add cmd arg to more functions
so that it can be used in the filter code
---
lib/cache/lvmetad.c | 8 ++++----
lib/device/dev-cache.c | 12 ++++++------
lib/device/dev-cache.h | 17 +++++++++--------
lib/filters/filter-composite.c | 8 ++++----
lib/filters/filter-fwraid.c | 2 +-
lib/filters/filter-internal.c | 2 +-
lib/filters/filter-md.c | 36 ++++++++++--------------------------
lib/filters/filter-mpath.c | 2 +-
lib/filters/filter-partitioned.c | 2 +-
lib/filters/filter-persistent.c | 4 ++--
lib/filters/filter-regex.c | 2 +-
lib/filters/filter-signature.c | 2 +-
lib/filters/filter-sysfs.c | 2 +-
lib/filters/filter-type.c | 2 +-
lib/filters/filter-usable.c | 2 +-
lib/label/label.c | 8 ++++----
lib/locking/lvmlockd.c | 2 +-
lib/metadata/lv_manip.c | 2 +-
lib/metadata/metadata.c | 2 +-
lib/metadata/mirror.c | 2 +-
tools/lvmdiskscan.c | 8 ++++----
tools/pvck.c | 2 +-
tools/pvscan.c | 8 ++++----
tools/reporter.c | 2 +-
tools/toollib.c | 10 +++++-----
25 files changed, 67 insertions(+), 82 deletions(-)
diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c
index 238a7f1..a75b448 100644
--- a/lib/cache/lvmetad.c
+++ b/lib/cache/lvmetad.c
@@ -863,9 +863,9 @@ static int _pv_populate_lvmcache(struct cmd_context *cmd,
return 0;
}
- dev = dev_cache_get_by_devt(devt, cmd->filter);
+ dev = dev_cache_get_by_devt(cmd, devt, cmd->filter);
if (!dev && fallback)
- dev = dev_cache_get_by_devt(fallback, cmd->filter);
+ dev = dev_cache_get_by_devt(cmd, fallback, cmd->filter);
if (!dev) {
log_warn("WARNING: Device for PV %s not found or rejected by a filter.", pvid_txt);
@@ -2404,7 +2404,7 @@ int lvmetad_pvscan_all_devs(struct cmd_context *cmd, int do_wait)
was_silent = silent_mode();
init_silent(1);
- while ((dev = dev_iter_get(iter))) {
+ while ((dev = dev_iter_get(cmd, iter))) {
if (sigint_caught()) {
ret = 0;
stack;
@@ -2549,7 +2549,7 @@ static void _update_pv_in_udev(struct cmd_context *cmd, dev_t devt)
#if 0
struct device *dev;
- if (!(dev = dev_cache_get_by_devt(devt, cmd->lvmetad_filter))) {
+ if (!(dev = dev_cache_get_by_devt(cmd, devt, cmd->lvmetad_filter))) {
log_error("_update_pv_in_udev no dev found");
return;
}
diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index d60454a..1635c99 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -1504,7 +1504,7 @@ const char *dev_cache_filtered_reason(const char *name)
return reason;
}
-struct device *dev_cache_get(const char *name, struct dev_filter *f)
+struct device *dev_cache_get(struct cmd_context *cmd, const char *name, struct dev_filter *f)
{
struct stat buf;
struct device *d = (struct device *) dm_hash_lookup(_cache.names, name);
@@ -1544,7 +1544,7 @@ struct device *dev_cache_get(const char *name, struct dev_filter *f)
return d;
if (f && !(d->flags & DEV_REGULAR)) {
- ret = f->passes_filter(f, d);
+ ret = f->passes_filter(cmd, f, d);
if (ret == -EAGAIN) {
log_debug_devs("get device by name defer filter %s", dev_name(d));
@@ -1576,7 +1576,7 @@ static struct device *_dev_cache_seek_devt(dev_t dev)
* TODO This is very inefficient. We probably want a hash table indexed by
* major:minor for keys to speed up these lookups.
*/
-struct device *dev_cache_get_by_devt(dev_t dev, struct dev_filter *f)
+struct device *dev_cache_get_by_devt(struct cmd_context *cmd, dev_t dev, struct dev_filter *f)
{
char path[PATH_MAX];
const char *sysfs_dir;
@@ -1617,7 +1617,7 @@ struct device *dev_cache_get_by_devt(dev_t dev, struct dev_filter *f)
if (!f)
return d;
- ret = f->passes_filter(f, d);
+ ret = f->passes_filter(cmd, f, d);
if (ret == -EAGAIN) {
log_debug_devs("get device by number defer filter %s", dev_name(d));
@@ -1662,7 +1662,7 @@ static struct device *_iter_next(struct dev_iter *iter)
return d;
}
-struct device *dev_iter_get(struct dev_iter *iter)
+struct device *dev_iter_get(struct cmd_context *cmd, struct dev_iter *iter)
{
struct dev_filter *f;
int ret;
@@ -1674,7 +1674,7 @@ struct device *dev_iter_get(struct dev_iter *iter)
f = iter->filter;
if (f && !(d->flags & DEV_REGULAR)) {
- ret = f->passes_filter(f, d);
+ ret = f->passes_filter(cmd, f, d);
if (ret == -EAGAIN) {
log_debug_devs("get device by iter defer filter %s", dev_name(d));
diff --git a/lib/device/dev-cache.h b/lib/device/dev-cache.h
index c56ff50..6386ba9 100644
--- a/lib/device/dev-cache.h
+++ b/lib/device/dev-cache.h
@@ -19,14 +19,15 @@
#include "lib/device/device.h"
#include "lib/misc/lvm-wrappers.h"
+struct cmd_context;
+
/*
* predicate for devices.
*/
struct dev_filter {
- int (*passes_filter) (struct dev_filter * f, struct device * dev);
- void (*destroy) (struct dev_filter * f);
- void (*wipe) (struct dev_filter * f);
- int (*dump) (struct dev_filter * f, int merge_existing);
+ int (*passes_filter) (struct cmd_context *cmd, struct dev_filter *f, struct device *dev);
+ void (*destroy) (struct dev_filter *f);
+ void (*wipe) (struct dev_filter *f);
void *private;
unsigned use_count;
};
@@ -38,9 +39,9 @@ struct dm_list *dev_cache_get_dev_list_for_lvid(const char *lvid);
/*
* The global device cache.
*/
-struct cmd_context;
int dev_cache_init(struct cmd_context *cmd);
int dev_cache_exit(void);
+
/*
* Returns number of open devices.
*/
@@ -52,11 +53,11 @@ int dev_cache_has_scanned(void);
int dev_cache_add_dir(const char *path);
int dev_cache_add_loopfile(const char *path);
__attribute__((nonnull(1)))
-struct device *dev_cache_get(const char *name, struct dev_filter *f);
+struct device *dev_cache_get(struct cmd_context *cmd, const char *name, struct dev_filter *f);
const char *dev_cache_filtered_reason(const char *name);
// TODO
-struct device *dev_cache_get_by_devt(dev_t device, struct dev_filter *f);
+struct device *dev_cache_get_by_devt(struct cmd_context *cmd, dev_t device, struct dev_filter *f);
void dev_set_preferred_name(struct dm_str_list *sl, struct device *dev);
@@ -66,7 +67,7 @@ void dev_set_preferred_name(struct dm_str_list *sl, struct device *dev);
struct dev_iter;
struct dev_iter *dev_iter_create(struct dev_filter *f, int unused);
void dev_iter_destroy(struct dev_iter *iter);
-struct device *dev_iter_get(struct dev_iter *iter);
+struct device *dev_iter_get(struct cmd_context *cmd, struct dev_iter *iter);
void dev_reset_error_count(struct cmd_context *cmd);
diff --git a/lib/filters/filter-composite.c b/lib/filters/filter-composite.c
index ba837af..a9374ab 100644
--- a/lib/filters/filter-composite.c
+++ b/lib/filters/filter-composite.c
@@ -18,13 +18,13 @@
#include "lib/filters/filter.h"
#include "lib/device/device.h"
-static int _and_p(struct dev_filter *f, struct device *dev)
+static int _and_p(struct cmd_context *cmd, struct dev_filter *f, struct device *dev)
{
struct dev_filter **filters;
int ret;
for (filters = (struct dev_filter **) f->private; *filters; ++filters) {
- ret = (*filters)->passes_filter(*filters, dev);
+ ret = (*filters)->passes_filter(cmd, *filters, dev);
if (!ret)
return 0; /* No 'stack': a filter, not an error. */
@@ -33,12 +33,12 @@ static int _and_p(struct dev_filter *f, struct device *dev)
return 1;
}
-static int _and_p_with_dev_ext_info(struct dev_filter *f, struct device *dev)
+static int _and_p_with_dev_ext_info(struct cmd_context *cmd, struct dev_filter *f, struct device *dev)
{
int r;
dev_ext_enable(dev, external_device_info_source());
- r = _and_p(f, dev);
+ r = _and_p(cmd, f, dev);
dev_ext_disable(dev);
return r;
diff --git a/lib/filters/filter-fwraid.c b/lib/filters/filter-fwraid.c
index 03c63b3..6f47692 100644
--- a/lib/filters/filter-fwraid.c
+++ b/lib/filters/filter-fwraid.c
@@ -64,7 +64,7 @@ static int _dev_is_fwraid(struct device *dev)
#define MSG_SKIPPING "%s: Skipping firmware RAID component device"
-static int _ignore_fwraid(struct dev_filter *f __attribute__((unused)),
+static int _ignore_fwraid(struct cmd_context *cmd, struct dev_filter *f __attribute__((unused)),
struct device *dev)
{
int ret;
diff --git a/lib/filters/filter-internal.c b/lib/filters/filter-internal.c
index 85e04d4..8cc0011 100644
--- a/lib/filters/filter-internal.c
+++ b/lib/filters/filter-internal.c
@@ -37,7 +37,7 @@ void internal_filter_clear(void)
dm_list_init(&_allow_devs);
}
-static int _passes_internal(struct dev_filter *f __attribute__((unused)),
+static int _passes_internal(struct cmd_context *cmd, struct dev_filter *f __attribute__((unused)),
struct device *dev)
{
struct device_list *devl;
diff --git a/lib/filters/filter-md.c b/lib/filters/filter-md.c
index 4fcbca9..95e0aad 100644
--- a/lib/filters/filter-md.c
+++ b/lib/filters/filter-md.c
@@ -70,6 +70,13 @@
*/
/*
+ * FIXME: for commands that want a full md check (pvcreate, vgcreate,
+ * vgextend), we do an extra read at the end of every device that the
+ * filter looks at. This isn't necessary; we only need to do the full
+ * md check on the PVs that these commands are trying to use.
+ */
+
+/*
* Returns 0 if:
* the device is an md component and it should be ignored.
*
@@ -81,7 +88,7 @@
* that will not pass.
*/
-static int _passes_md_filter(struct device *dev, int full)
+static int _passes_md_filter(struct cmd_context *cmd, struct dev_filter *f __attribute__((unused)), struct device *dev)
{
int ret;
@@ -92,7 +99,7 @@ static int _passes_md_filter(struct device *dev, int full)
if (!md_filtering())
return 1;
- ret = dev_is_md(dev, NULL, full);
+ ret = dev_is_md(dev, NULL, cmd->use_full_md_check);
if (ret == -EAGAIN) {
/* let pass, call again after scan */
@@ -122,18 +129,6 @@ static int _passes_md_filter(struct device *dev, int full)
return 1;
}
-static int _passes_md_filter_lite(struct dev_filter *f __attribute__((unused)),
- struct device *dev)
-{
- return _passes_md_filter(dev, 0);
-}
-
-static int _passes_md_filter_full(struct dev_filter *f __attribute__((unused)),
- struct device *dev)
-{
- return _passes_md_filter(dev, 1);
-}
-
static void _destroy(struct dev_filter *f)
{
if (f->use_count)
@@ -151,18 +146,7 @@ struct dev_filter *md_filter_create(struct cmd_context *cmd, struct dev_types *d
return NULL;
}
- /*
- * FIXME: for commands that want a full md check (pvcreate, vgcreate,
- * vgextend), we do an extra read at the end of every device that the
- * filter looks at. This isn't necessary; we only need to do the full
- * md check on the PVs that these commands are trying to use.
- */
-
- if (cmd->use_full_md_check)
- f->passes_filter = _passes_md_filter_full;
- else
- f->passes_filter = _passes_md_filter_lite;
-
+ f->passes_filter = _passes_md_filter;
f->destroy = _destroy;
f->use_count = 0;
f->private = dt;
diff --git a/lib/filters/filter-mpath.c b/lib/filters/filter-mpath.c
index 785b518..bcd1e52 100644
--- a/lib/filters/filter-mpath.c
+++ b/lib/filters/filter-mpath.c
@@ -247,7 +247,7 @@ static int _dev_is_mpath(struct dev_filter *f, struct device *dev)
#define MSG_SKIPPING "%s: Skipping mpath component device"
-static int _ignore_mpath(struct dev_filter *f, struct device *dev)
+static int _ignore_mpath(struct cmd_context *cmd, struct dev_filter *f, struct device *dev)
{
if (_dev_is_mpath(f, dev) == 1) {
if (dev->ext.src == DEV_EXT_NONE)
diff --git a/lib/filters/filter-partitioned.c b/lib/filters/filter-partitioned.c
index 34151fd..6418cdf 100644
--- a/lib/filters/filter-partitioned.c
+++ b/lib/filters/filter-partitioned.c
@@ -19,7 +19,7 @@
#define MSG_SKIPPING "%s: Skipping: Partition table signature found"
-static int _passes_partitioned_filter(struct dev_filter *f, struct device *dev)
+static int _passes_partitioned_filter(struct cmd_context *cmd, struct dev_filter *f, struct device *dev)
{
struct dev_types *dt = (struct dev_types *) f->private;
int ret;
diff --git a/lib/filters/filter-persistent.c b/lib/filters/filter-persistent.c
index 9ee3957..1782bfa 100644
--- a/lib/filters/filter-persistent.c
+++ b/lib/filters/filter-persistent.c
@@ -68,7 +68,7 @@ static void _persistent_filter_wipe(struct dev_filter *f)
dm_hash_wipe(pf->devices);
}
-static int _lookup_p(struct dev_filter *f, struct device *dev)
+static int _lookup_p(struct cmd_context *cmd, struct dev_filter *f, struct device *dev)
{
struct pfilter *pf = (struct pfilter *) f->private;
void *l;
@@ -99,7 +99,7 @@ static int _lookup_p(struct dev_filter *f, struct device *dev)
if (!l) {
dev->flags &= ~DEV_FILTER_AFTER_SCAN;
- pass = pf->real->passes_filter(pf->real, dev);
+ pass = pf->real->passes_filter(cmd, pf->real, dev);
if (!pass) {
/*
diff --git a/lib/filters/filter-regex.c b/lib/filters/filter-regex.c
index c642ec4..1a8e8a2 100644
--- a/lib/filters/filter-regex.c
+++ b/lib/filters/filter-regex.c
@@ -145,7 +145,7 @@ static int _build_matcher(struct rfilter *rf, const struct dm_config_value *val)
return r;
}
-static int _accept_p(struct dev_filter *f, struct device *dev)
+static int _accept_p(struct cmd_context *cmd, struct dev_filter *f, struct device *dev)
{
int m, first = 1, rejected = 0;
struct rfilter *rf = (struct rfilter *) f->private;
diff --git a/lib/filters/filter-signature.c b/lib/filters/filter-signature.c
index d4b6ea3..5c5796f 100644
--- a/lib/filters/filter-signature.c
+++ b/lib/filters/filter-signature.c
@@ -21,7 +21,7 @@
#define BUFSIZE 4096
-static int _ignore_signature(struct dev_filter *f __attribute__((unused)),
+static int _ignore_signature(struct cmd_context *cmd, struct dev_filter *f __attribute__((unused)),
struct device *dev)
{
char buf[BUFSIZE];
diff --git a/lib/filters/filter-sysfs.c b/lib/filters/filter-sysfs.c
index 5b54312..c77c4a6 100644
--- a/lib/filters/filter-sysfs.c
+++ b/lib/filters/filter-sysfs.c
@@ -260,7 +260,7 @@ static int _init_devs(struct dev_set *ds)
}
-static int _accept_p(struct dev_filter *f, struct device *dev)
+static int _accept_p(struct cmd_context *cmd, struct dev_filter *f, struct device *dev)
{
struct dev_set *ds = (struct dev_set *) f->private;
diff --git a/lib/filters/filter-type.c b/lib/filters/filter-type.c
index 63d7c70..3b0a644 100644
--- a/lib/filters/filter-type.c
+++ b/lib/filters/filter-type.c
@@ -17,7 +17,7 @@
#include "lib/misc/lib.h"
#include "lib/filters/filter.h"
-static int _passes_lvm_type_device_filter(struct dev_filter *f, struct device *dev)
+static int _passes_lvm_type_device_filter(struct cmd_context *cmd, struct dev_filter *f, struct device *dev)
{
struct dev_types *dt = (struct dev_types *) f->private;
const char *name = dev_name(dev);
diff --git a/lib/filters/filter-usable.c b/lib/filters/filter-usable.c
index 498b90c..ab5c02f 100644
--- a/lib/filters/filter-usable.c
+++ b/lib/filters/filter-usable.c
@@ -100,7 +100,7 @@ static int _check_pv_min_size(struct device *dev)
return 0;
}
-static int _passes_usable_filter(struct dev_filter *f, struct device *dev)
+static int _passes_usable_filter(struct cmd_context *cmd, struct dev_filter *f, struct device *dev)
{
filter_mode_t mode = *((filter_mode_t *) f->private);
struct dev_usable_check_params ucp = {0};
diff --git a/lib/label/label.c b/lib/label/label.c
index 373df29..de5aa88 100644
--- a/lib/label/label.c
+++ b/lib/label/label.c
@@ -366,7 +366,7 @@ static int _process_block(struct cmd_context *cmd, struct dev_filter *f,
log_debug_devs("Scan filtering %s", dev_name(dev));
- pass = f->passes_filter(f, dev);
+ pass = f->passes_filter(cmd, f, dev);
if ((pass == -EAGAIN) || (dev->flags & DEV_FILTER_AFTER_SCAN)) {
/* Shouldn't happen */
@@ -833,7 +833,7 @@ int label_scan(struct cmd_context *cmd)
return 0;
}
- while ((dev = dev_iter_get(iter))) {
+ while ((dev = dev_iter_get(cmd, iter))) {
if (!(devl = zalloc(sizeof(*devl))))
continue;
devl->dev = dev;
@@ -946,7 +946,7 @@ void label_scan_invalidate_lv(struct cmd_context *cmd, struct logical_volume *lv
lv_info(cmd, lv, 0, &lvinfo, 0, 0);
devt = MKDEV(lvinfo.major, lvinfo.minor);
- if ((dev = dev_cache_get_by_devt(devt, NULL)))
+ if ((dev = dev_cache_get_by_devt(cmd, devt, NULL)))
label_scan_invalidate(dev);
}
@@ -963,7 +963,7 @@ void label_scan_drop(struct cmd_context *cmd)
if (!(iter = dev_iter_create(NULL, 0)))
return;
- while ((dev = dev_iter_get(iter))) {
+ while ((dev = dev_iter_get(cmd, iter))) {
if (_in_bcache(dev))
_scan_dev_close(dev);
}
diff --git a/lib/locking/lvmlockd.c b/lib/locking/lvmlockd.c
index 21a9696..a277246 100644
--- a/lib/locking/lvmlockd.c
+++ b/lib/locking/lvmlockd.c
@@ -398,7 +398,7 @@ static int _extend_sanlock_lv(struct cmd_context *cmd, struct volume_group *vg,
log_print("Zeroing %u MiB on extended internal lvmlock LV...", extend_mb);
- if (!(dev = dev_cache_get(path, NULL))) {
+ if (!(dev = dev_cache_get(cmd, path, NULL))) {
log_error("Extend sanlock LV %s cannot find device.", display_lvname(lv));
return 0;
}
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index b2eba30..27cd2c1 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -7145,7 +7145,7 @@ int wipe_lv(struct logical_volume *lv, struct wipe_params wp)
return 0;
}
- if (!(dev = dev_cache_get(name, NULL))) {
+ if (!(dev = dev_cache_get(lv->vg->cmd, name, NULL))) {
log_error("%s: not found: device not cleared", name);
return 0;
}
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 113c87c..34b1ec7 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -1510,7 +1510,7 @@ struct pv_list *find_pv_in_vg(const struct volume_group *vg,
const char *pv_name)
{
struct pv_list *pvl;
- struct device *dev = dev_cache_get(pv_name, vg->cmd->filter);
+ struct device *dev = dev_cache_get(vg->cmd, pv_name, vg->cmd->filter);
/*
* If the device does not exist or is filtered out, don't bother trying
diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c
index 8de1440..11f2a8f 100644
--- a/lib/metadata/mirror.c
+++ b/lib/metadata/mirror.c
@@ -292,7 +292,7 @@ static int _write_log_header(struct cmd_context *cmd, struct logical_volume *lv)
log_verbose("Writing log header for LV %s to device %s.", display_lvname(lv), name);
- if (!(dev = dev_cache_get(name, NULL))) {
+ if (!(dev = dev_cache_get(cmd, name, NULL))) {
log_error("%s: not found: log header not written.", name);
return 0;
}
diff --git a/tools/lvmdiskscan.c b/tools/lvmdiskscan.c
index 772694c..0b97eba 100644
--- a/tools/lvmdiskscan.c
+++ b/tools/lvmdiskscan.c
@@ -27,7 +27,7 @@ int pv_disks_found;
int pv_parts_found;
int max_len;
-static int _get_max_dev_name_len(struct dev_filter *filter)
+static int _get_max_dev_name_len(struct cmd_context *cmd, struct dev_filter *filter)
{
int len = 0;
int maxlen = 0;
@@ -40,7 +40,7 @@ static int _get_max_dev_name_len(struct dev_filter *filter)
}
/* Do scan */
- for (dev = dev_iter_get(iter); dev; dev = dev_iter_get(iter)) {
+ for (dev = dev_iter_get(cmd, iter); dev; dev = dev_iter_get(cmd, iter)) {
len = strlen(dev_name(dev));
if (len > maxlen)
maxlen = len;
@@ -100,14 +100,14 @@ int lvmdiskscan(struct cmd_context *cmd, int argc __attribute__((unused)),
/* Call before using dev_iter which uses filters which want bcache data. */
label_scan(cmd);
- max_len = _get_max_dev_name_len(cmd->full_filter);
+ max_len = _get_max_dev_name_len(cmd, cmd->full_filter);
if (!(iter = dev_iter_create(cmd->full_filter, 0))) {
log_error("dev_iter_create failed");
return ECMD_FAILED;
}
- for (dev = dev_iter_get(iter); dev; dev = dev_iter_get(iter)) {
+ for (dev = dev_iter_get(cmd, iter); dev; dev = dev_iter_get(cmd, iter)) {
if (lvmcache_has_dev_info(dev)) {
if (!dev_get_size(dev, &size)) {
log_error("Couldn't get size of \"%s\"",
diff --git a/tools/pvck.c b/tools/pvck.c
index 027df6d..ce74036 100644
--- a/tools/pvck.c
+++ b/tools/pvck.c
@@ -35,7 +35,7 @@ int pvck(struct cmd_context *cmd, int argc, char **argv)
pv_name = argv[i];
- dev = dev_cache_get(pv_name, cmd->filter);
+ dev = dev_cache_get(cmd, pv_name, cmd->filter);
if (!dev) {
log_error("Device %s %s.", pv_name, dev_cache_filtered_reason(pv_name));
diff --git a/tools/pvscan.c b/tools/pvscan.c
index 61530ee..17fc1a6 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -438,10 +438,10 @@ static int _pvscan_cache(struct cmd_context *cmd, int argc, char **argv)
while (argc--) {
pv_name = *argv++;
if (pv_name[0] == '/') {
- if (!(dev = dev_cache_get(pv_name, cmd->lvmetad_filter))) {
+ if (!(dev = dev_cache_get(cmd, pv_name, cmd->lvmetad_filter))) {
/* Remove device path from lvmetad. */
log_debug("Removing dev %s from lvmetad cache.", pv_name);
- if ((dev = dev_cache_get(pv_name, NULL))) {
+ if ((dev = dev_cache_get(cmd, pv_name, NULL))) {
if (!_lvmetad_clear_dev(dev->dev, MAJOR(dev->dev), MINOR(dev->dev)))
remove_errors++;
} else {
@@ -468,7 +468,7 @@ static int _pvscan_cache(struct cmd_context *cmd, int argc, char **argv)
}
devno = MKDEV((dev_t)major, (dev_t)minor);
- if (!(dev = dev_cache_get_by_devt(devno, cmd->lvmetad_filter))) {
+ if (!(dev = dev_cache_get_by_devt(cmd, devno, cmd->lvmetad_filter))) {
/* Remove major:minor from lvmetad. */
log_debug("Removing dev %d:%d from lvmetad cache.", major, minor);
if (!_lvmetad_clear_dev(devno, major, minor))
@@ -531,7 +531,7 @@ static int _pvscan_cache(struct cmd_context *cmd, int argc, char **argv)
devno = MKDEV((dev_t)major, (dev_t)minor);
- if (!(dev = dev_cache_get_by_devt(devno, cmd->lvmetad_filter))) {
+ if (!(dev = dev_cache_get_by_devt(cmd, devno, cmd->lvmetad_filter))) {
/* Remove major:minor from lvmetad. */
log_debug("Removing dev %d:%d from lvmetad cache.", major, minor);
if (!_lvmetad_clear_dev(devno, major, minor))
diff --git a/tools/reporter.c b/tools/reporter.c
index a7f1f9b..faaff37 100644
--- a/tools/reporter.c
+++ b/tools/reporter.c
@@ -719,7 +719,7 @@ static void _check_pv_list(struct cmd_context *cmd, struct report_args *args, st
if (single_args->args_are_pvs && args->argc) {
for (i = 0; i < args->argc; i++) {
- if (!rescan_done && !dev_cache_get(args->argv[i], cmd->full_filter)) {
+ if (!rescan_done && !dev_cache_get(cmd, args->argv[i], cmd->full_filter)) {
cmd->filter->wipe(cmd->filter);
/* FIXME scan only one device */
lvmcache_label_scan(cmd);
diff --git a/tools/toollib.c b/tools/toollib.c
index f64bd58..c81d1c2 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -1470,7 +1470,7 @@ int process_each_label(struct cmd_context *cmd, int argc, char **argv,
if (argc) {
for (; opt < argc; opt++) {
- if (!(dev = dev_cache_get(argv[opt], cmd->full_filter))) {
+ if (!(dev = dev_cache_get(cmd, argv[opt], cmd->full_filter))) {
log_error("Failed to find device "
"\"%s\".", argv[opt]);
ret_max = ECMD_FAILED;
@@ -1547,7 +1547,7 @@ int process_each_label(struct cmd_context *cmd, int argc, char **argv,
goto out;
}
- while ((dev = dev_iter_get(iter)))
+ while ((dev = dev_iter_get(cmd, iter)))
{
if (!(label = lvmcache_get_dev_label(dev)))
continue;
@@ -3870,7 +3870,7 @@ static int _get_arg_devices(struct cmd_context *cmd,
return ECMD_FAILED;
}
- if (!(dil->dev = dev_cache_get(sl->str, cmd->filter))) {
+ if (!(dil->dev = dev_cache_get(cmd, sl->str, cmd->filter))) {
log_error("Failed to find device for physical volume \"%s\".", sl->str);
ret_max = ECMD_FAILED;
} else {
@@ -3898,7 +3898,7 @@ static int _get_all_devices(struct cmd_context *cmd, struct dm_list *all_devices
return ECMD_FAILED;
}
- while ((dev = dev_iter_get(iter))) {
+ while ((dev = dev_iter_get(cmd, iter))) {
if (!(dil = dm_pool_alloc(cmd->mem, sizeof(*dil)))) {
log_error("device_id_list alloc failed.");
goto out;
@@ -5398,7 +5398,7 @@ int pvcreate_each_device(struct cmd_context *cmd,
* Translate arg names into struct device's.
*/
dm_list_iterate_items(pd, &pp->arg_devices)
- pd->dev = dev_cache_get(pd->name, cmd->full_filter);
+ pd->dev = dev_cache_get(cmd, pd->name, cmd->full_filter);
/*
* Use process_each_pv to search all existing PVs and devices.
6 years
master - rpm: drop no longer present clvmd, lvm2app
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=27c647d6ce707326237...
Commit: 27c647d6ce707326237771d3b046b6049161fb5a
Parent: 2a7f2a3a244dd02cacb947b19f7400b53dd71ca4
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 15 00:47:35 2018 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 15 00:47:35 2018 +0200
rpm: drop no longer present clvmd, lvm2app
---
spec/packages.inc | 102 -----------------------------------------------------
spec/source.inc | 1 -
2 files changed, 0 insertions(+), 103 deletions(-)
diff --git a/spec/packages.inc b/spec/packages.inc
index cdcc197..bf2432a 100644
--- a/spec/packages.inc
+++ b/spec/packages.inc
@@ -229,11 +229,8 @@ the lvm2 libraries.
%files devel
%defattr(-,root,root,-)
-%{_libdir}/liblvm2app.so
%{_libdir}/liblvm2cmd.so
-%{_includedir}/lvm2app.h
%{_includedir}/lvm2cmd.h
-%{_libdir}/pkgconfig/lvm2app.pc
%{_libdir}/libdevmapper-event-lvm2.so
%package libs
@@ -251,7 +248,6 @@ This package contains shared lvm2 libraries for applications.
%files libs
%defattr(-,root,root,-)
-%attr(755,root,root) %{_libdir}/liblvm2app.so.*
%attr(755,root,root) %{_libdir}/liblvm2cmd.so.*
%attr(755,root,root) %{_libdir}/libdevmapper-event-lvm2.so.*
%dir %{_libdir}/device-mapper
@@ -291,10 +287,8 @@ LVM commands use lvmlockd to coordinate access to shared storage.
%post lockd
%daemon_reload
%enable -s lvmlockd -t service
-%enable -s lvmlocking -t service
%preun lockd
-%disable -s lvmlocking -t service
%disable -s lvmlockd -t service
%postun lockd
@@ -309,66 +303,6 @@ fi
%{_mandir}/man8/lvmlockctl.8.gz
%dir %{_default_locking_dir}
%{_unitdir}/lvm2-lvmlockd.service
-%{_unitdir}/lvm2-lvmlocking.service
-%endif
-
-##############################################################################
-# Cluster subpackage
-##############################################################################
-%if %{have_with clvmd}
-
-%package cluster
-Summary: Cluster extensions for userland logical volume management tools
-License: GPLv2
-Group: System Environment/Base
-Requires: lvm2 >= %{version}-%{release}
-Requires(post): chkconfig
-Requires(preun): chkconfig
-Requires(preun): device-mapper >= %{device_mapper_version}
-Requires(preun): lvm2 >= 2.02
-%maybe Requires: %{req_cluster}
-
-%description cluster
-
-Extensions to LVM2 to support clusters.
-
-%post cluster
-%daemon_reload
-%enable -s clvmd -t service
-%if %{have_service clvmd}
-if [ $1 = 2 ]; then
- if [ -e %{_default_pid_dir}/clvmd.pid ]; then
- %{_sbindir}/clvmd -S >/dev/null 2>&1 || :
- fi
-fi
-%endif
-
-%preun cluster
-%disable -s clvmd -t service
-%if %{have_service clvmd}
-if [ $1 = 0 ]; then
- # lvmconf may no longer exist if lvm2 is being removed in the same rpm run
- if test -x /sbin/lvmconf; then /sbin/lvmconf --disable-cluster; fi
-fi
-%endif
-
-%postun cluster
-if [ $1 = 0 ]; then
-%daemon_reload
-fi
-
-%files cluster
-%defattr(-,root,root,-)
-%attr(755,root,root) /usr/sbin/clvmd
-%{_mandir}/man8/clvmd.8.gz
-%if %{enable_systemd}
- %{_unitdir}/lvm2-clvmd.service
- %{_unitdir}/lvm2-cluster-activation.service
- %{_unitdir}/../lvm2-cluster-activation
-%else
- %{_sysconfdir}/rc.d/init.d/clvmd
-%endif
-
%endif
##############################################################################
@@ -413,42 +347,6 @@ fi
%endif
##############################################################################
-# Python bindings
-##############################################################################
-%if %{enable_python}
-%package python-libs
-Summary: Python module to access LVM
-License: LGPLv2
-Group: Development/Libraries
-Provides: python-lvm = %{version}-%{release}
-Requires: %{name}-libs = %{version}-%{release}
-
-%description python-libs
-Python module to allow the creation and use of LVM
-logical volumes, physical volumes, and volume groups.
-
-%files python-libs
-%{python_sitearch}/*
-%endif
-
-%if %{enable_python3}
-%package python3-libs
-Summary: Python 3 module to access LVM
-License: LGPLv2
-Group: Development/Libraries
-Provides: python3-lvm = %{version}-%{release}
-Requires: %{name}-libs = %{version}-%{release}
-
-%description python3-libs
-Python 3 module to allow the creation and use of LVM
-logical volumes, physical volumes, and volume groups.
-
-%files python3-libs
-%{python3_sitearch}/*.so
-%{python3_sitearch}/*.egg-info
-%endif
-
-##############################################################################
# LVM D-Bus daemon
##############################################################################
%if %{enable_dbusd}
diff --git a/spec/source.inc b/spec/source.inc
index fb7ccf5..6a485ef 100644
--- a/spec/source.inc
+++ b/spec/source.inc
@@ -30,7 +30,6 @@
# enable service only if you know what you are doing
#
%if %{enable_cmirror}
-#service clvmd 1
#service cmirrord 1
%endif
6 years