master - cleanup: drop extra ()
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=fa1a0d170ad719...
Commit: fa1a0d170ad7193e9d0c6fe828a5c5df24806a54
Parent: 2a0ec5d3968414bff251f1750e911c9dd120ca69
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Aug 29 11:58:16 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Aug 29 13:11:35 2014 +0200
cleanup: drop extra ()
Pure '==' test doesn't need extra ().
---
libdm/libdm-report.c | 2 +-
tools/lvchange.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c
index 6e7167f..8c27c5b 100644
--- a/libdm/libdm-report.c
+++ b/libdm/libdm-report.c
@@ -2122,7 +2122,7 @@ static const char *_tok_value_string_list(const struct dm_report_field_type *ft,
}
/* Store information whether [] or {} was used. */
- if ((end_op_flag_expected == SEL_LIST_LE))
+ if (end_op_flag_expected == SEL_LIST_LE)
ssl->type |= SEL_LIST_LS;
else
ssl->type |= SEL_LIST_SUBSET_LS;
diff --git a/tools/lvchange.c b/tools/lvchange.c
index 0981f2c..31c397b 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -794,7 +794,7 @@ static int lvchange_writemostly(struct logical_volume *lv)
* We don't bother checking the metadata area,
* since writemostly only affects the data areas.
*/
- if ((seg_type(raid_seg, s) == AREA_UNASSIGNED))
+ if (seg_type(raid_seg, s) == AREA_UNASSIGNED)
continue;
if (lv_is_on_pv(seg_lv(raid_seg, s), pvl->pv)) {
9 years, 1 month
master - cleanup: drop duplicate const
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2a0ec5d3968414...
Commit: 2a0ec5d3968414bff251f1750e911c9dd120ca69
Parent: 19375e4fcabea7ffcf2b249f6738218b3885c871
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Aug 29 11:51:53 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Aug 29 13:11:34 2014 +0200
cleanup: drop duplicate const
No need to specify 'const' twice in these cases.
---
lib/raid/raid.c | 2 +-
lib/report/report.c | 10 +++++-----
lib/thin/thin.c | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/lib/raid/raid.c b/lib/raid/raid.c
index 5aad447..831c912 100644
--- a/lib/raid/raid.c
+++ b/lib/raid/raid.c
@@ -335,7 +335,7 @@ static int _raid_target_present(struct cmd_context *cmd,
uint32_t min;
unsigned raid_feature;
const char *feature;
- } const _features[] = {
+ } _features[] = {
{ 1, 3, RAID_FEATURE_RAID10, "raid10" },
};
diff --git a/lib/report/report.c b/lib/report/report.c
index 84ca73b..f315df4 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -54,11 +54,11 @@ enum {
static const uint64_t _zero64 = UINT64_C(0);
static const uint64_t _one64 = UINT64_C(1);
-static const char const _str_zero[] = "0";
-static const char const _str_one[] = "1";
-static const char const _str_no[] = "no";
-static const char const _str_yes[] = "yes";
-static const char const _str_unknown[] = "unknown";
+static const char _str_zero[] = "0";
+static const char _str_one[] = "1";
+static const char _str_no[] = "no";
+static const char _str_yes[] = "yes";
+static const char _str_unknown[] = "unknown";
/*
* 32 bit signed is casted to 64 bit unsigned in dm_report_field internally!
diff --git a/lib/thin/thin.c b/lib/thin/thin.c
index 020ccc1..6982782 100644
--- a/lib/thin/thin.c
+++ b/lib/thin/thin.c
@@ -642,7 +642,7 @@ static int _thin_target_present(struct cmd_context *cmd,
uint32_t min;
unsigned thin_feature;
const char *feature;
- } const _features[] = {
+ } _features[] = {
{ 1, 1, THIN_FEATURE_DISCARDS, "discards" },
{ 1, 1, THIN_FEATURE_EXTERNAL_ORIGIN, "external_origin" },
{ 1, 4, THIN_FEATURE_BLOCK_SIZE, "block_size" },
9 years, 1 month
master - cleanup: assignment into ()
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=19375e4fcabea7...
Commit: 19375e4fcabea7ffcf2b249f6738218b3885c871
Parent: db77041d93a946384cadecdb3a33466e09f77b00
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Aug 28 13:53:36 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Aug 29 13:11:34 2014 +0200
cleanup: assignment into ()
Put is_float=1 into () - so the intention is obvious.
Remove uneeded extra check for for *s != 0,
since it's already checked for either digit or '.'.
---
libdm/libdm-report.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c
index cd42b11..6e7167f 100644
--- a/libdm/libdm-report.c
+++ b/libdm/libdm-report.c
@@ -1721,7 +1721,7 @@ static const char *_tok_value_number(const char *s,
int is_float = 0;
*begin = s;
- while (*s && ((!is_float && *s=='.' && (is_float=1)) || isdigit(*s)))
+ while ((!is_float && (*s == '.') && ((is_float = 1))) || isdigit(*s))
s++;
*end = s;
9 years, 1 month
master - makefiles: include path missing
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=db77041d93a946...
Commit: db77041d93a946384cadecdb3a33466e09f77b00
Parent: ca32920b1646b5d124c729e1ed7a83ce277d4803
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Aug 29 12:51:28 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Aug 29 13:10:20 2014 +0200
makefiles: include path missing
For deps calcs path for blkid.h needs to be known.
---
make.tmpl.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/make.tmpl.in b/make.tmpl.in
index 5d4c144..5e597df 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -411,7 +411,7 @@ $(LIB_STATIC): $(OBJECTS)
set -e; \
FILE=`echo $@ | sed 's/\\//\\\\\\//g;s/\\.d//g'`; \
DEPS=`echo $(DEPS) | sed -e 's/\\//\\\\\\//g'`; \
- $(CC) -MM $(INCLUDES) $(DEFS) -o $@ $<; \
+ $(CC) -MM $(INCLUDES) $(BLKID_CFLAGS) $(DEFS) -o $@ $<; \
sed -i "s/\(.*\)\.o[ :]*/$$FILE.o $$FILE.d $$FILE.pot: $$DEPS /g" $@; \
DEPLIST=`sed 's/ \\\\//;s/.*://;' < $@`; \
echo $$DEPLIST | fmt -1 | sed 's/ //g;s/\(.*\)/\1:/' >> $@; \
9 years, 1 month
master - WHATS_NEW
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ca32920b1646b5...
Commit: ca32920b1646b5d124c729e1ed7a83ce277d4803
Parent: 3c8fa2aa01dd6639b146e537ddcc2709752678d2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Aug 29 13:00:16 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Aug 29 13:10:20 2014 +0200
WHATS_NEW
---
WHATS_NEW | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 79e32e7..6758389 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.111 -
===================================
+ Pass properly sized char buffers for sscanf when initializing clvmd.
Reinstate nosync logic when extending mirror. (2.02.110)
Fix total area extent calculation when allocating cache pool. (2.02.110)
9 years, 1 month
master - clvmd: use correctly sized buffers for sscanf
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3c8fa2aa01dd66...
Commit: 3c8fa2aa01dd6639b146e537ddcc2709752678d2
Parent: 91a453de0506a68b374e4e4b36f904eb5bb5a46f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Aug 29 12:00:05 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Aug 29 13:10:20 2014 +0200
clvmd: use correctly sized buffers for sscanf
sscanf needs extra 1 char for '\0'
---
daemons/clvmd/lvm-functions.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/daemons/clvmd/lvm-functions.c b/daemons/clvmd/lvm-functions.c
index 1754b7d..f3a56ce 100644
--- a/daemons/clvmd/lvm-functions.c
+++ b/daemons/clvmd/lvm-functions.c
@@ -725,7 +725,7 @@ void do_lock_vg(unsigned char command, unsigned char lock_flags, char *resource)
static int get_initial_state(struct dm_hash_table *excl_uuid)
{
int lock_mode;
- char lv[64], vg[64], flags[25], vg_flags[25];
+ char lv[65], vg[65], flags[26], vg_flags[26]; /* with space for '\0' */
char uuid[65];
char line[255];
char *lvs_cmd;
9 years, 1 month
master - WHATS_NEW_DM
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=91a453de0506a6...
Commit: 91a453de0506a68b374e4e4b36f904eb5bb5a46f
Parent: 93e9b3a1d142b3fcef3866599f8e395636a25ddb
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Aug 29 12:57:30 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Aug 29 13:10:19 2014 +0200
WHATS_NEW_DM
---
WHATS_NEW_DM | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index afdb1d0..3012ef1 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.90 -
==================================
+ Restore proper buffer size for parsing mountinfo line (1.02.89)
Version 1.02.89 - 26th August 2014
==================================
9 years, 1 month
master - libdm: revert incorrect path length size for sscanf
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=93e9b3a1d142b3...
Commit: 93e9b3a1d142b3fcef3866599f8e395636a25ddb
Parent: 2faf416e0ed639b453c4ccf0d7f6f0217b644d5d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Aug 29 11:52:45 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Aug 29 13:10:18 2014 +0200
libdm: revert incorrect path length size for sscanf
Commit 94786a3bbf0b68883a2618c9bc25fc88e367f9f8 introduced
another bug - since sscanf needs extra 1 byte for \0.
Since there is no easy way to do a macro evaluation for (PATH_MAX-1)
and string concatation of this number to get resulting (%4095s) - let's
go with easiest path and restore extra byte for 0.
Other option would be to prepare sscanf parsing string in runtime.
But lets resolve it when we look at PATH_MAX handling later...
---
libdm/libdm-common.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c
index bfa60a2..bd51645 100644
--- a/libdm/libdm-common.c
+++ b/libdm/libdm-common.c
@@ -1649,8 +1649,8 @@ static void _unmangle_mountinfo_string(const char *src, char *buf)
/* Parse one line of mountinfo and unmangled target line */
static int _mountinfo_parse_line(const char *line, unsigned *maj, unsigned *min, char *buf)
{
- char root[PATH_MAX];
- char target[PATH_MAX];
+ char root[PATH_MAX + 1]; /* sscanf needs extra '\0' */
+ char target[PATH_MAX + 1];
/* TODO: maybe detect availability of %ms glib support ? */
if (sscanf(line, "%*u %*u %u:%u %" DM_TO_STRING(PATH_MAX)
9 years, 1 month
master - lvextend: Reinstate --nosync logic for mirrors.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2faf416e0ed639...
Commit: 2faf416e0ed639b453c4ccf0d7f6f0217b644d5d
Parent: 3003a9a7be35dc8a6f87ceddd5cdc9bf6b021bfa
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Thu Aug 28 00:40:09 2014 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Thu Aug 28 00:40:09 2014 +0100
lvextend: Reinstate --nosync logic for mirrors.
Reinstate the logic for syncing extensions of mirrors created with
--nosync. (Inadvertently disabled by the approximate allocation
changes.)
---
WHATS_NEW | 3 ++-
lib/metadata/lv_manip.c | 12 ++++++++----
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 02ee1b0..79e32e7 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,6 +1,7 @@
Version 2.02.111 -
===================================
- Fix regression in cache pool allocation (2.02.110).
+ Reinstate nosync logic when extending mirror. (2.02.110)
+ Fix total area extent calculation when allocating cache pool. (2.02.110)
Version 2.02.110 - 26th August 2014
===================================
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index baf431f..fcf9975 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -3670,6 +3670,8 @@ int lv_extend(struct logical_volume *lv,
int log_count = 0;
struct alloc_handle *ah;
uint32_t sub_lv_count;
+ uint32_t old_extents;
+ uint32_t new_extents; /* Total logical size after extension. */
log_very_verbose("Adding segment of type %s to LV %s.", segtype->name, lv->name);
@@ -3695,9 +3697,9 @@ int lv_extend(struct logical_volume *lv,
allocatable_pvs, alloc, approx_alloc, NULL)))
return_0;
- extents = ah->new_extents;
+ new_extents = ah->new_extents;
if (segtype_is_raid(segtype))
- extents -= ah->log_len * ah->area_multiple;
+ new_extents -= ah->log_len * ah->area_multiple;
if (segtype_is_thin_pool(segtype) || segtype_is_cache_pool(segtype)) {
if (lv->le_count) {
@@ -3723,6 +3725,8 @@ int lv_extend(struct logical_volume *lv,
else
sub_lv_count = mirrors;
+ old_extents = lv->le_count;
+
if (!lv->le_count &&
!(r = _lv_insert_empty_sublvs(lv, segtype, stripe_size,
region_size, sub_lv_count))) {
@@ -3730,7 +3734,7 @@ int lv_extend(struct logical_volume *lv,
goto out;
}
- if (!(r = _lv_extend_layered_lv(ah, lv, extents - lv->le_count, 0,
+ if (!(r = _lv_extend_layered_lv(ah, lv, new_extents - lv->le_count, 0,
stripes, stripe_size)))
goto_out;
@@ -3739,7 +3743,7 @@ int lv_extend(struct logical_volume *lv,
* resync of the extension if the LV is currently in-sync
* and the LV has the LV_NOTSYNCED flag set.
*/
- if ((lv->le_count != extents) &&
+ if (old_extents &&
segtype_is_mirrored(segtype) &&
(lv->status & LV_NOTSYNCED)) {
dm_percent_t sync_percent = DM_PERCENT_INVALID;
9 years, 1 month
v2_02_110 annotated tag has been created
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7e2df52bb287c2...
Commit: 7e2df52bb287c2ed9c763efa5b1c78dcdb83d739
Parent: 0000000000000000000000000000000000000000
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: 2014-08-26 15:34 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: 2014-08-26 15:34 +0000
annotated tag: v2_02_110 has been created
at 7e2df52bb287c2ed9c763efa5b1c78dcdb83d739 (tag)
tagging 8b8d21f8733d800dd672bcc629b20d8585d2021a (commit)
replaces v2_02_109
Release 2.02.110.
55 files changed, 1576 insertions(+), 687 deletions(-)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
iEYEABECAAYFAlP8qRwACgkQIoGRwVZ+LBfJlACfVYfCku+bPngyJU+QB69SrV7b
F8oAoPonrJliRJ0HLHFYAeDuUoP+UbGV
=tJaX
-----END PGP SIGNATURE-----
Alasdair G Kergon (8):
post-release
pvcreate: Fix cache state with filters/sig wiping.
libdm: Add DM_DEFERRED_REMOVE to dm-ioctl.h.
dmsetup: Support remove --deferred.
lvresize: Fix raid/mirror and %PE handling code.
configure: Fix shared lvm1 typo.
autoreconf
pre-release
David Teigland (1):
lvcreate: disallow snapshot of cache lv
Jonathan Brassow (2):
RAID: Fail RAID4/5/6 creation if PE size is less than STRIPE_SIZE_MIN
cleanup: Remove extra ';' from the end of a line.
Peter Rajnoha (25):
pvmove: remove spurious "Skipping mirror LV" message on pvmove of clustered mirror
activation: if LV inactive and non-clustered, do not issue "Cannot deactivate" on -aln
filter-mpath: fix primary device lookup failure for partition when processing mpath filter
select: fix string list selection to match whole words only but not prefixes of searched string
select: add support for selection to match string list subset, recognize { } operator
tests: update report-select test for latest changes
refactor: add defines for raid segtypes
cache+thin: add lv_is_{cache,thin}_origin fn to identify origin LVs
report: lvs: properly display 'o' for volume type bit and 'C' for target type bit in lv_attr field for cache origin LVs
WHATS_NEW: previous commit
Add lv_layout_and_type fn, lv_layout and lv_type reporting fields.
man: missing (C)ache in target type lv_attr description
cleanup: gcc warning
cleanup: gcc warning
report: fix thin external snapshot identification for lv_layout and lv_type fields
report: also display "mirror" keyword in lv_type for pvmove LV and display "multiple" for external origin used for more than one thin snapshot
report: also display "mirror" keyword in lv_layout for mirrored mirror log and "cache" keyword in lv_layout for cached cache pool
lv: remove lv_type_name fn
lvconvert: snapshot: allow using raid1 for snapshot and snapshot origin
man: dmsetup: -n is shortcut for --notable, not --noheadings
refactor: rename 'lv_type' field to 'lv_role'
report: add dm_report_field_string_list_unsorted
report: use dm_report_field_string_list_unordered for reporting lv_layout and lv_role fields
cleanup: consolidate lv_layout and lv_role reporting
revert: commit 8d00499167f010b82ea6ddebcc6b22ec170002f9
Zdenek Kabelac (33):
lvconvert: show name of activated volume
toollib: print ignoring vorigin
man: show lv name for lvs
man: add some more reserved names
cleanup: postpone confirmation prompt for snapshot
cleanup: move test for free arg
cleanup: simplier struct initilization
cleanup: drop unneeded inits
cleanup: just easier word wrapping
cleanup: drop extra braces
cleanup: quite gcc warn
cleanup: gcc warn fix
cleanup: use display_lvname
dmeventd: fix test for select return value
metadata: check result of refresh and rescan
lvscan: check result of id_write_format
lv_manip: check for str_list_dup failure
libdm: check version prints error
cleanup: reindent and make obvious error path
cleanup: use _ prefix for static functions
cleanup: use just PATH_MAX size
cleanup: avoid double assign
cleanup: simplier struct init
tests: proper /dev access
thin: more forced ignoring of pool failure
thin: fix volume_list support
libdm: add check transaction_id after message
cleanup: never return uninitialized buffer
cleanup: use unsigned 1bit elements
cleanup: check pv_count is not 0
cleanup: indent and stacktrack
tests: fix volume list test
tests: thin and volume_list testing
9 years, 1 month