master - Revert "lvcreate: raid0 needs default number of stripes"
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c425cdd115d56a...
Commit: c425cdd115d56a0f0ec7779934f194af88487905
Parent: 081e569e14cbf3f3c73aedf0e107b8b3a2c69455
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Fri Jul 15 21:53:37 2016 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Fri Jul 15 21:53:37 2016 +0100
Revert "lvcreate: raid0 needs default number of stripes"
This reverts commit 3928c96a37941d765bf467d82502cd2aec7fd809.
A new setting is required in lvm.conf to control this.
---
tools/lvcreate.c | 64 +++++++++++++++++++++++++++---------------------------
1 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index 6eca8f2..0dd9b1e 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -458,28 +458,16 @@ static int _read_mirror_params(struct cmd_context *cmd,
static int _read_raid_params(struct cmd_context *cmd,
struct lvcreate_params *lp)
{
- if (lp->stripes < 2) {
- if (segtype_is_raid10(lp->segtype)) {
- if (arg_is_set(cmd, stripes_ARG)) {
- /* User supplied the bad argument */
- log_error("Segment type 'raid10' requires 2 or more stripes.");
- return 0;
- }
- /* No stripe argument was given - default to 2 */
- /* FIXME: this needs to change to 3 once we support odd numbers of stripes */
- lp->stripes = 2;
- } else if (segtype_is_any_raid6(lp->segtype))
- lp->stripes = 3;
- else if (segtype_is_raid4(lp->segtype) ||
- segtype_is_any_raid5(lp->segtype) ||
- segtype_is_any_raid0(lp->segtype))
- lp->stripes = 2;
- else
- lp->stripes = 1;
- }
-
- if (lp->stripes > 1)
+ if ((lp->stripes < 2) && segtype_is_raid10(lp->segtype)) {
+ if (arg_is_set(cmd, stripes_ARG)) {
+ /* User supplied the bad argument */
+ log_error("Segment type 'raid10' requires 2 or more stripes.");
+ return 0;
+ }
+ /* No stripe argument was given - default to 2 */
+ lp->stripes = 2;
lp->stripe_size = find_config_tree_int(cmd, metadata_stripesize_CFG, NULL) * 2;
+ }
/*
* RAID1 does not take a stripe arg
@@ -1231,31 +1219,43 @@ static int _check_raid_parameters(struct volume_group *vg,
struct lvcreate_params *lp,
struct lvcreate_cmdline_params *lcp)
{
+ unsigned devs = lcp->pv_count ? : dm_list_size(&vg->pvs);
struct cmd_context *cmd = vg->cmd;
if (!seg_is_mirrored(lp) && !lp->stripe_size)
lp->stripe_size = find_config_tree_int(cmd, metadata_stripesize_CFG, NULL) * 2;
- if (segtype_is_any_raid0(lp->segtype) ||
- segtype_is_raid4(lp->segtype) ||
- segtype_is_any_raid5(lp->segtype)) {
+ if (seg_is_any_raid0(lp)) {
if (lp->stripes < 2) {
- log_error("Segment type \'%s\' requires 2 or more stripes.", lp->segtype->name);
+ log_error("Segment type 'raid0' requires 2 or more stripes.");
return 0;
}
- } else if (segtype_is_any_raid6(lp->segtype)) {
- if (lp->stripes < 3) {
- log_error("Segment type \'%s\' requires 3 or more stripes.", lp->segtype->name);
+ } else if (!seg_is_mirrored(lp)) {
+ /*
+ * If number of devices was not supplied, we can infer from
+ * the PVs given.
+ */
+ if (!arg_is_set(cmd, stripes_ARG) &&
+ (devs > 2 * lp->segtype->parity_devs))
+ lp->stripes = devs - lp->segtype->parity_devs;
+
+ if (lp->stripes <= lp->segtype->parity_devs) {
+ log_error("Number of stripes must be at least %d for %s",
+ lp->segtype->parity_devs + 1,
+ lp->segtype->name);
return 0;
}
- } else if (segtype_is_raid10(lp->segtype)) {
+ } else if (segtype_is_any_raid0(lp->segtype) ||
+ segtype_is_raid10(lp->segtype)) {
+ if (!arg_is_set(cmd, stripes_ARG))
+ lp->stripes = devs / lp->mirrors;
if (lp->stripes < 2) {
- log_error("Unable to create %s LV: "
- "insufficient number of devices.", lp->segtype->name);
+ log_error("Unable to create RAID(1)0 LV: "
+ "insufficient number of devices.");
return 0;
}
}
- /* 'mirrors' defaults to 2 */
+ /* 'mirrors' defaults to 2 - not the number of PVs supplied */
return 1;
}
7 years, 9 months
master - man: drop lvmraid references from lvconvert
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=081e569e14cbf3...
Commit: 081e569e14cbf3f3c73aedf0e107b8b3a2c69455
Parent: e96d1ad3efea51448f0cdd39e7c84db05d3c6cbf
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Jul 15 15:08:02 2016 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Jul 15 15:08:02 2016 -0500
man: drop lvmraid references from lvconvert
---
man/lvconvert.8.in | 16 ++++------------
1 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/man/lvconvert.8.in b/man/lvconvert.8.in
index 5f15f34..95f7095 100644
--- a/man/lvconvert.8.in
+++ b/man/lvconvert.8.in
@@ -205,9 +205,6 @@ The
type refers to one of many raid levels, e.g.
.B raid1,
.B raid5.
-See
-.BR lvmraid (7)
-for a full list.
.SS LV layers
@@ -328,7 +325,7 @@ VG/StripedLV
Convert StripedLV to type raid*.
.br
\[bu]
-Required options depend on the raid level, see lvmraid(7).
+Required options depend on the raid level.
.SS Operations on RaidLV with type raid*:
@@ -453,7 +450,7 @@ VG/RaidLV
Convert RaidLV to use a different raid level.
.br
\[bu]
-Required options depend on the raid level, see lvmraid(7).
+Required options depend on the raid level.
.B lvconvert \-\-type striped
VG/RaidLV
@@ -514,7 +511,7 @@ VG/MirrorLV
Convert MirrorLV to type raid*.
.br
\[bu]
-Required options depend on the raid level, see lvmraid(7).
+Required options depend on the raid level.
.SS Operations on CachePoolLV with type cache\-pool:
@@ -918,8 +915,6 @@ Use \fB\-f\fP if you do not want any replacement. You may use
\fB\-\-use\-policies\fP to use the device replacement policy specified in
\fBlvm.conf\fP(5), see \fBactivation/mirror_log_fault_policy\fP or
\fBactivation/mirror_device_fault_policy\fP.
-Also see
-.BR lvmraid (7).
When used with a thin pool LV, this option automates the use of the
\fBthin_repair\fP(8) tool on the thin pool. This repairs a very limitted
@@ -937,10 +932,7 @@ Also see
Remove the specified device \fIPhysicalVolume\fP and replace it with one
that is available in the VG, or from a specific list of PVs specified on
the command line following the LV name. This option may be repeated multiple
-times depending on the RaidLV type. See
-.BR lvmraid (7)
-for specific limits on device replacement for each raid level.
-(This option only applies to \fBraid*\fP LV types.)
+times depending on the RaidLV type.
.
.HP
.BR \-s ,
7 years, 9 months
master - cleanup: local static functions with _
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e96d1ad3efea51...
Commit: e96d1ad3efea51448f0cdd39e7c84db05d3c6cbf
Parent: 4de7a843ebc5c9ed4c54225a1a062cf40534edaf
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jul 15 13:20:35 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jul 15 15:49:01 2016 +0200
cleanup: local static functions with _
---
libdaemon/server/daemon-server.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
index e4d7ce2..c3402a0 100644
--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -319,7 +319,7 @@ error:
goto out;
}
-static void remove_lockfile(const char *file)
+static void _remove_lockfile(const char *file)
{
if (unlink(file))
perror("unlink failed");
@@ -418,7 +418,7 @@ end:
return res;
}
-static response builtin_handler(daemon_state s, client_handle h, request r)
+static response _builtin_handler(daemon_state s, client_handle h, request r)
{
const char *rq = daemon_request_str(r, "request", "NONE");
response res = { .error = EPROTO };
@@ -432,7 +432,7 @@ static response builtin_handler(daemon_state s, client_handle h, request r)
return res;
}
-static void *client_thread(void *state)
+static void *_client_thread(void *state)
{
thread_state *ts = state;
request req;
@@ -451,7 +451,7 @@ static void *client_thread(void *state)
else
daemon_log_cft(ts->s.log, DAEMON_LOG_WIRE, "<- ", req.cft->root);
- res = builtin_handler(ts->s, ts->client, req);
+ res = _builtin_handler(ts->s, ts->client, req);
if (res.error == EPROTO) /* Not a builtin, delegate to the custom handler. */
res = ts->s.handler(ts->s, ts->client, req);
@@ -512,7 +512,7 @@ static int handle_connect(daemon_state s)
ts->s = s;
ts->client = client;
- if (pthread_create(&ts->client.thread_id, NULL, client_thread, ts)) {
+ if (pthread_create(&ts->client.thread_id, NULL, _client_thread, ts)) {
ERROR(&s, "Failed to create client thread.");
return 0;
}
@@ -520,7 +520,7 @@ static int handle_connect(daemon_state s)
return 1;
}
-static void reap(daemon_state s, int waiting)
+static void _reap(daemon_state s, int waiting)
{
thread_state *last = s.threads, *ts = last->next;
void *rv;
@@ -637,7 +637,7 @@ void daemon_start(daemon_state s)
handle_connect(s);
}
- reap(s, 0);
+ _reap(s, 0);
if (_shutdown_requested && !s.threads->next)
break;
@@ -653,7 +653,7 @@ void daemon_start(daemon_state s)
}
INFO(&s, "%s waiting for client threads to finish", s.name);
- reap(s, 1);
+ _reap(s, 1);
out:
/* If activated by systemd, do not unlink the socket - systemd takes care of that! */
if (!_systemd_activation && s.socket_fd >= 0)
@@ -672,7 +672,7 @@ out:
closelog(); /* FIXME */
if (s.pidfile)
- remove_lockfile(s.pidfile);
+ _remove_lockfile(s.pidfile);
if (failed)
exit(1);
}
7 years, 9 months
master - coverity: close socket before closing app
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4de7a843ebc5c9...
Commit: 4de7a843ebc5c9ed4c54225a1a062cf40534edaf
Parent: d2bb19e883f46a95e9780cea046e6e0a5db006b9
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jul 15 15:42:01 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jul 15 15:49:01 2016 +0200
coverity: close socket before closing app
Opened socket descriptor goes out-of-sight still opened.
Close it - but since this happens before app exit, it
just fixed valgrind report.
---
libdaemon/server/daemon-server.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
index 7911dd6..e4d7ce2 100644
--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -660,6 +660,10 @@ out:
if (unlink(s.socket_path))
perror("unlink error");
+ if (s.socket_fd >= 0)
+ if (close(s.socket_fd))
+ perror("scoket close");
+
if (s.daemon_fini)
if (!s.daemon_fini(&s))
failed = 1;
7 years, 9 months
master - tests: check fail path on cache creation
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d2bb19e883f46a...
Commit: d2bb19e883f46a95e9780cea046e6e0a5db006b9
Parent: a57bf37cdb89aced30bf27d61e87388704a7d9c6
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jul 15 15:47:33 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jul 15 15:49:01 2016 +0200
tests: check fail path on cache creation
---
test/shell/lvcreate-cache-fail.sh | 41 +++++++++++++++++++++++++++++++++++++
1 files changed, 41 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvcreate-cache-fail.sh b/test/shell/lvcreate-cache-fail.sh
new file mode 100644
index 0000000..2ff4865
--- /dev/null
+++ b/test/shell/lvcreate-cache-fail.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+# Copyright (C) 2016 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# Exercise creation of cache and cache pool volumes and failure path
+# https://bugzilla.redhat.com/1355923
+
+SKIP_WITH_LVMLOCKD=1
+SKIP_WITH_LVMPOLLD=1
+
+. lib/inittest
+
+aux have_cache 1 3 0 || skip
+
+#aux prepare_pvs 1 4707950
+#vgcreate $vg "$dev1"
+#lvcreate -L4T -n $lv1 $vg
+#lvcreate -H -L500G -n cache $vg/$lv1
+#fail lvcreate -H -l 127999 -n cache $vg/$lv1
+
+aux prepare_vg 1 20
+lvcreate -L10 -n $lv1 $vg
+fail lvcreate -H -L2 -n cache $vg/$lv1
+
+lvs -a $vg
+vgs $vg
+lvdisplay $vg
+
+#dmsetup table
+#dmsetup status
+#time dmsetup suspend ${vg}-${lv1}
+#time dmsetup resume ${vg}-${lv1}
+
+vgremove -ff $vg
7 years, 9 months
master - tests: require better cache driver
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a57bf37cdb89ac...
Commit: a57bf37cdb89aced30bf27d61e87388704a7d9c6
Parent: 12925d8b70c88e1a7a98e69ab896eb16ed2602fc
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jul 14 13:40:22 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jul 15 15:49:01 2016 +0200
tests: require better cache driver
Version 1.4 can't handle this test without killing itself.
---
test/shell/lvchange-cache-mode.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/shell/lvchange-cache-mode.sh b/test/shell/lvchange-cache-mode.sh
index 239960c..947034b 100644
--- a/test/shell/lvchange-cache-mode.sh
+++ b/test/shell/lvchange-cache-mode.sh
@@ -16,7 +16,7 @@ SKIP_WITH_LVMPOLLD=1
. lib/inittest
-aux have_cache 1 3 0 || skip
+aux have_cache 1 5 0 || skip
aux prepare_vg 2
7 years, 9 months
master - string: Add first_substring().
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=12925d8b70c88e...
Commit: 12925d8b70c88e1a7a98e69ab896eb16ed2602fc
Parent: 5af311ddd8f5c03839b1c2a8feff5eb8dfde5606
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Thu Jul 14 14:46:38 2016 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Thu Jul 14 14:46:38 2016 +0100
string: Add first_substring().
---
lib/misc/lvm-string.c | 16 ++++++++++++++++
lib/misc/lvm-string.h | 8 ++++++++
2 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/lib/misc/lvm-string.c b/lib/misc/lvm-string.c
index 809c63c..cdcc993 100644
--- a/lib/misc/lvm-string.c
+++ b/lib/misc/lvm-string.c
@@ -243,3 +243,19 @@ char *build_dm_uuid(struct dm_pool *mem, const struct logical_volume *lv,
return dlid;
}
+
+char *first_substring(const char *str, ...)
+{
+ char *substr, *r = NULL;
+ va_list ap;
+
+ va_start(ap, str);
+
+ while ((substr = va_arg(ap, char *)))
+ if ((r = strstr(str, substr)))
+ break;
+
+ va_end(ap);
+
+ return r;
+}
diff --git a/lib/misc/lvm-string.h b/lib/misc/lvm-string.h
index d96dad5..ebdf956 100644
--- a/lib/misc/lvm-string.h
+++ b/lib/misc/lvm-string.h
@@ -49,4 +49,12 @@ void copy_systemid_chars(const char *src, char *dst);
int apply_lvname_restrictions(const char *name);
int is_reserved_lvname(const char *name);
+/*
+ * Provided with a NULL-terminated argument list of const char *
+ * substrings that might be contained within the string str, use
+ * strstr() to search str for each in turn and return a pointer to the
+ * first match or else NULL.
+ */
+char *first_substring(const char *str, ...);
+
#endif
7 years, 9 months
master - macros: Add lv_is_not_synced.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5af311ddd8f5c0...
Commit: 5af311ddd8f5c03839b1c2a8feff5eb8dfde5606
Parent: 07be2b864f131f2ec48fe2a22e0a50ea76dd5a70
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Thu Jul 14 14:21:01 2016 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Thu Jul 14 14:21:01 2016 +0100
macros: Add lv_is_not_synced.
---
lib/metadata/lv.c | 4 ++--
lib/metadata/lv_manip.c | 2 +-
lib/metadata/metadata-exported.h | 1 +
lib/metadata/raid_manip.c | 2 +-
lib/report/report.c | 2 +-
tools/lvchange.c | 2 +-
tools/lvconvert.c | 2 +-
7 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/lib/metadata/lv.c b/lib/metadata/lv.c
index e7a56cf..9ee67b4 100644
--- a/lib/metadata/lv.c
+++ b/lib/metadata/lv.c
@@ -1140,9 +1140,9 @@ char *lv_attr_dup_with_info_and_seg_status(struct dm_pool *mem, const struct lv_
else if (lv_is_cache_type(lv))
repstr[0] = 'C';
else if (lv_is_raid(lv))
- repstr[0] = (lv->status & LV_NOTSYNCED) ? 'R' : 'r';
+ repstr[0] = (lv_is_not_synced(lv)) ? 'R' : 'r';
else if (lv_is_mirror(lv))
- repstr[0] = (lv->status & LV_NOTSYNCED) ? 'M' : 'm';
+ repstr[0] = (lv_is_not_synced(lv)) ? 'M' : 'm';
else if (lv_is_thin_volume(lv))
repstr[0] = lv_is_merging_origin(lv) ?
'O' : (lv_is_merging_thin_snapshot(lv) ? 'S' : 'V');
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index a47bd16..c6b8eb5 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -4027,7 +4027,7 @@ int lv_extend(struct logical_volume *lv,
*/
if (old_extents &&
segtype_is_mirrored(segtype) &&
- (lv->status & LV_NOTSYNCED)) {
+ (lv_is_not_synced(lv))) {
dm_percent_t sync_percent = DM_PERCENT_INVALID;
if (!lv_is_active_locally(lv)) {
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index 84b510b..37d4bf8 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -218,6 +218,7 @@
#define lv_is_mirror_log(lv) (((lv)->status & MIRROR_LOG) ? 1 : 0)
#define lv_is_mirror(lv) (((lv)->status & MIRROR) ? 1 : 0)
#define lv_is_mirror_type(lv) (((lv)->status & (MIRROR | MIRROR_LOG | MIRROR_IMAGE)) ? 1 : 0)
+#define lv_is_not_synced(lv) (((lv)->status & LV_NOTSYNCED) ? 1 : 0)
#define lv_is_pending_delete(lv) (((lv)->status & LV_PENDING_DELETE) ? 1 : 0)
#define lv_is_error_when_full(lv) (((lv)->status & LV_ERROR_WHEN_FULL) ? 1 : 0)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 2ef47b2..feb8d6e 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -590,7 +590,7 @@ static int _raid_add_images(struct logical_volume *lv,
struct lv_list *lvl;
struct lv_segment_area *new_areas;
- if (lv->status & LV_NOTSYNCED) {
+ if (lv_is_not_synced(lv)) {
log_error("Can't add image to out-of-sync RAID LV:"
" use 'lvchange --resync' first.");
return 0;
diff --git a/lib/report/report.c b/lib/report/report.c
index 512986e..fab6379 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -3161,7 +3161,7 @@ static int _lvinitialimagesync_disp(struct dm_report *rh, struct dm_pool *mem,
int initial_image_sync;
if (lv_is_raid(lv) || lv_is_mirrored(lv))
- initial_image_sync = (lv->status & LV_NOTSYNCED) == 0;
+ initial_image_sync = !lv_is_not_synced(lv);
else
initial_image_sync = 0;
diff --git a/tools/lvchange.c b/tools/lvchange.c
index 4b02ba9..9194cd6 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -404,7 +404,7 @@ static int _lvchange_resync(struct cmd_context *cmd, struct logical_volume *lv)
* worry about persistent logs.
*/
if (!seg_is_raid(seg) && !seg->log_lv) {
- if (lv->status & LV_NOTSYNCED) {
+ if (lv_is_not_synced(lv)) {
lv->status &= ~LV_NOTSYNCED;
log_very_verbose("Updating logical volume %s on disk(s).",
display_lvname(lv));
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index b8c1959..0368e84 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -1418,7 +1418,7 @@ static int _lvconvert_mirrors_aux(struct cmd_context *cmd,
* Up-convert m-way mirror to n-way mirror
*/
if (new_mimage_count > old_mimage_count) {
- if (lv->status & LV_NOTSYNCED) {
+ if (lv_is_not_synced(lv)) {
log_error("Can't add mirror to out-of-sync mirrored "
"LV: use lvchange --resync first.");
return 0;
7 years, 9 months
master - lvmdump: include major and minor numbers for pvs and lvs reports
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=07be2b864f131f...
Commit: 07be2b864f131f2ec48fe2a22e0a50ea76dd5a70
Parent: 4e1bf7acd39e2e6686f634be29b2c64a0aab705c
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Jul 14 14:33:33 2016 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Jul 14 14:33:33 2016 +0200
lvmdump: include major and minor numbers for pvs and lvs reports
Including major and minor numbers in pvs and lvs output when calling
lvmdump -a makes it a bit easier to match these items with possible
system log/journal.
---
scripts/lvmdump.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/lvmdump.sh b/scripts/lvmdump.sh
index bfe79d9..d13a69b 100755
--- a/scripts/lvmdump.sh
+++ b/scripts/lvmdump.sh
@@ -142,10 +142,10 @@ if (( $advanced )); then
log "\"$LVM\" pvscan -v >> \"$dir/pvscan\" 2>> \"$log\""
myecho " lvs..."
- log "\"$LVM\" lvs -a -H -o +devices >> \"$dir/lvs\" 2>> \"$log\""
+ log "\"$LVM\" lvs -a -H -o +devices,kernel_major,kernel_minor >> \"$dir/lvs\" 2>> \"$log\""
myecho " pvs..."
- log "\"$LVM\" pvs -a -v >> \"$dir/pvs\" 2>> \"$log\""
+ log "\"$LVM\" pvs -a -o +major,minor -v >> \"$dir/pvs\" 2>> \"$log\""
myecho " vgs..."
log "\"$LVM\" vgs -v >> \"$dir/vgs\" 2>> \"$log\""
7 years, 9 months
master - coverity: add some tests for function results
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4e1bf7acd39e2e...
Commit: 4e1bf7acd39e2e6686f634be29b2c64a0aab705c
Parent: 4661c6b6fb7adc01a3fd42b5e802051b92d15d9d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jul 12 16:43:12 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Jul 13 21:52:14 2016 +0200
coverity: add some tests for function results
Even though they cannot normally happen...
---
daemons/lvmetad/lvmetad-core.c | 2 +-
lib/metadata/metadata.c | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c
index 31d0933..c4c1d68 100644
--- a/daemons/lvmetad/lvmetad-core.c
+++ b/daemons/lvmetad/lvmetad-core.c
@@ -861,7 +861,7 @@ static int remove_metadata(lvmetad_state *s, const char *vgid, int update_pvids)
/* update_pvid_to_vgid will clear/free the pvid_to_vgid hash */
if (update_pvids && meta_lookup)
- _update_pvid_to_vgid(s, meta_lookup, "#orphan", 0);
+ (void) _update_pvid_to_vgid(s, meta_lookup, "#orphan", 0);
/* free the unmapped data */
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index d8bb726..8a9a1b2 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -4641,7 +4641,8 @@ static int _check_devs_used_correspond_with_lv(struct dm_pool *mem, struct dm_li
dev = dl->dev;
if (!(dev->flags & DEV_ASSUMED_FOR_LV)) {
if (!found_inconsistent) {
- dm_pool_begin_object(mem, 32);
+ if (!dm_pool_begin_object(mem, 32))
+ return_0;
found_inconsistent = 1;
} else {
if (!dm_pool_grow_object(mem, DEV_LIST_DELIM, sizeof(DEV_LIST_DELIM) - 1))
@@ -4674,7 +4675,8 @@ static int _check_devs_used_correspond_with_lv(struct dm_pool *mem, struct dm_li
}
if (!(dev->flags & DEV_USED_FOR_LV)) {
if (!found_inconsistent) {
- dm_pool_begin_object(mem, 32);
+ if (!dm_pool_begin_object(mem, 32))
+ return_0;
found_inconsistent = 1;
} else {
if (!dm_pool_grow_object(mem, DEV_LIST_DELIM, sizeof(DEV_LIST_DELIM) - 1))
7 years, 9 months