master - cleanup: gcc warn about comparing int with uint
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1be74cfd7f9481...
Commit: 1be74cfd7f948123544872abb5e80994182e04d8
Parent: 0f7975cb351158d3b2245b4262761a698c6c5d7b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Apr 12 11:47:21 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Apr 12 11:47:51 2016 +0200
cleanup: gcc warn about comparing int with uint
---
.../dmeventd/plugins/snapshot/dmeventd_snapshot.c | 4 ++--
lib/activate/dev_manager.c | 2 +-
libdm/ioctl/libdm-iface.c | 6 +++---
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c b/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c
index 26fdfed..7b060ed 100644
--- a/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c
+++ b/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c
@@ -148,8 +148,8 @@ static void _umount(const char *device, int major, int minor)
continue; /* can't stat, skip this one */
if (S_ISBLK(st.st_mode) &&
- major(st.st_rdev) == major &&
- minor(st.st_rdev) == minor) {
+ (int) major(st.st_rdev) == major &&
+ (int) minor(st.st_rdev) == minor) {
log_error("Unmounting invalid snapshot %s from %s.", device, words[1]);
if (!_run(UMOUNT_COMMAND, "-fl", words[1], NULL))
log_error("Failed to umount snapshot %s from %s: %s.",
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 3f91654..a0e05ad 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -1687,7 +1687,7 @@ static int _add_dev_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
/*
* FIXME compare info.major with lv->major if multiple major support
*/
- if (info.exists && (info.minor != lv->minor)) {
+ if (info.exists && ((int) info.minor != lv->minor)) {
log_error("Volume %s (%" PRIu32 ":%" PRIu32")"
" differs from already active device "
"(%" PRIu32 ":%" PRIu32")",
diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c
index 2733b86..0c798f5 100644
--- a/libdm/ioctl/libdm-iface.c
+++ b/libdm/ioctl/libdm-iface.c
@@ -1169,9 +1169,9 @@ static struct dm_ioctl *_flatten(struct dm_task *dmt, unsigned repeat_count)
}
if (!_dm_multiple_major_support && dmt->allow_default_major_fallback &&
- dmt->major != _dm_device_major) {
- log_verbose("Overriding major number of %" PRIu32
- " with %" PRIu32 " for persistent device.",
+ dmt->major != (int) _dm_device_major) {
+ log_verbose("Overriding major number of %d "
+ "with %u for persistent device.",
dmt->major, _dm_device_major);
dmt->major = _dm_device_major;
}
7 years, 5 months
master - cleanup: avoid declaring var in the middle of code
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0f7975cb351158...
Commit: 0f7975cb351158d3b2245b4262761a698c6c5d7b
Parent: 147c9c01a21687b82314a62571cfc390a9a606a8
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Apr 12 11:46:41 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Apr 12 11:47:51 2016 +0200
cleanup: avoid declaring var in the middle of code
Easier to read code.
---
lib/device/dev-cache.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index 6abb6a7..b5f2152 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -904,11 +904,11 @@ int dev_cache_index_devs(void)
} else if (!sysfs_has_dev_block)
return 1;
- int with_udev = obtain_device_list_from_udev() &&
- udev_get_library_context();
+ if (obtain_device_list_from_udev() &&
+ udev_get_library_context())
+ return _dev_cache_iterate_devs_for_index(); /* with udev */
- return with_udev ? _dev_cache_iterate_devs_for_index()
- : _dev_cache_iterate_sysfs_for_index(path);
+ return _dev_cache_iterate_sysfs_for_index(path);
}
#ifdef UDEV_SYNC_SUPPORT
7 years, 5 months
master - rename function read_vgname to read_vgsummary
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=147c9c01a21687...
Commit: 147c9c01a21687b82314a62571cfc390a9a606a8
Parent: fe65a86cbc98bb38014b238266a7732de42d0aa1
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Feb 9 13:32:26 2016 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Apr 11 13:07:48 2016 -0500
rename function read_vgname to read_vgsummary
The name did not clearly represent what it does.
---
lib/format_text/format-text.c | 2 +-
lib/format_text/import-export.h | 8 ++++----
lib/format_text/import.c | 4 ++--
lib/format_text/import_vsn1.c | 12 ++++++++----
4 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c
index 408e63c..6053610 100644
--- a/lib/format_text/format-text.c
+++ b/lib/format_text/format-text.c
@@ -1210,7 +1210,7 @@ int vgname_from_mda(const struct format_type *fmt,
used_cached_metadata = 1;
/* FIXME 64-bit */
- if (!text_vgname_import(fmt, dev_area->dev,
+ if (!text_vgsummary_import(fmt, dev_area->dev,
(off_t) (dev_area->start + rlocn->offset),
(uint32_t) (rlocn->size - wrap),
(off_t) (dev_area->start + MDA_HEADER_SIZE),
diff --git a/lib/format_text/import-export.h b/lib/format_text/import-export.h
index 074b118..c081c51 100644
--- a/lib/format_text/import-export.h
+++ b/lib/format_text/import-export.h
@@ -51,9 +51,9 @@ struct text_vg_version_ops {
unsigned allow_lvmetad_extensions);
void (*read_desc) (struct dm_pool * mem, const struct dm_config_tree *cf,
time_t *when, char **desc);
- int (*read_vgname) (const struct format_type *fmt,
- const struct dm_config_tree *cft,
- struct lvmcache_vgsummary *vgsummary);
+ int (*read_vgsummary) (const struct format_type *fmt,
+ const struct dm_config_tree *cft,
+ struct lvmcache_vgsummary *vgsummary);
};
struct text_vg_version_ops *text_vg_vsn1_init(void);
@@ -78,7 +78,7 @@ struct volume_group *text_vg_import_fd(struct format_instance *fid,
uint32_t checksum,
time_t *when, char **desc);
-int text_vgname_import(const struct format_type *fmt,
+int text_vgsummary_import(const struct format_type *fmt,
struct device *dev,
off_t offset, uint32_t size,
off_t offset2, uint32_t size2,
diff --git a/lib/format_text/import.c b/lib/format_text/import.c
index 5b4f4a9..629884b 100644
--- a/lib/format_text/import.c
+++ b/lib/format_text/import.c
@@ -35,7 +35,7 @@ static void _init_text_import(void)
/*
* Find out vgname on a given device.
*/
-int text_vgname_import(const struct format_type *fmt,
+int text_vgsummary_import(const struct format_type *fmt,
struct device *dev,
off_t offset, uint32_t size,
off_t offset2, uint32_t size2,
@@ -74,7 +74,7 @@ int text_vgname_import(const struct format_type *fmt,
if (!(*vsn)->check_version(cft))
continue;
- if (!(*vsn)->read_vgname(fmt, cft, vgsummary))
+ if (!(*vsn)->read_vgsummary(fmt, cft, vgsummary))
goto_out;
r = 1;
diff --git a/lib/format_text/import_vsn1.c b/lib/format_text/import_vsn1.c
index 3bf5f7b..22f519e 100644
--- a/lib/format_text/import_vsn1.c
+++ b/lib/format_text/import_vsn1.c
@@ -1229,12 +1229,16 @@ static void _read_desc(struct dm_pool *mem,
}
/*
- * It would be more accurate to call this _read_vgsummary().
* It is used to read vgsummary information about a VG
* before locking and reading the VG via vg_read().
+ * read_vgsummary: read VG metadata before VG is locked
+ * and save the data in struct vgsummary
+ * read_vg: read VG metadata after VG is locked
+ * and save the data in struct volume_group
+ * FIXME: why are these separate?
*/
-static int _read_vgname(const struct format_type *fmt, const struct dm_config_tree *cft,
- struct lvmcache_vgsummary *vgsummary)
+static int _read_vgsummary(const struct format_type *fmt, const struct dm_config_tree *cft,
+ struct lvmcache_vgsummary *vgsummary)
{
const struct dm_config_node *vgn;
struct dm_pool *mem = fmt->cmd->mem;
@@ -1285,7 +1289,7 @@ static struct text_vg_version_ops _vsn1_ops = {
.check_version = _vsn1_check_version,
.read_vg = _read_vg,
.read_desc = _read_desc,
- .read_vgname = _read_vgname,
+ .read_vgsummary = _read_vgsummary
};
struct text_vg_version_ops *text_vg_vsn1_init(void)
7 years, 5 months
master - devcache: do not insert devices without device node
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=fe65a86cbc98bb...
Commit: fe65a86cbc98bb38014b238266a7732de42d0aa1
Parent: 07a60b59f789e089761170f977defbd38defacef
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Apr 11 10:08:16 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Apr 11 10:33:14 2016 +0200
devcache: do not insert devices without device node
When not obtaining device from udev, we are doing deep devdir scan,
and at the same time we try to insert everything what /sys/dev/block
knows about. However in case lvm2 is configured to use nonstardard
devdir this way it will see (and scan) devices from a real system.
lvm2 test suite is using its own test devdir with its
own device nodes. To avoid touching real /dev devices, validate
the device node exist in give dir and do not insert such device
into a cache.
With obtain list from udev this patch has no effect
(the normal user path).
---
WHATS_NEW | 1 +
lib/device/dev-cache.c | 9 +++++++++
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 777c44e..f4eb6ad 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.151
=================================
+ When not obtaining devs from udev, check they exist before caching them.
Detect device mismatch also when compiling without udev support.
Version 2.02.150 - 9th April 2016
diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index 84471ab..6abb6a7 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -433,6 +433,8 @@ static struct dm_list *_get_or_add_list_by_index_key(struct dm_hash_table *idx,
static struct device *_insert_sysfs_dev(dev_t devno, const char *devname)
{
+ static struct device _fake_dev = { .flags = DEV_USED_FOR_LV };
+ struct stat stat0;
char path[PATH_MAX];
char *path_copy;
struct device *dev;
@@ -442,6 +444,13 @@ static struct device *_insert_sysfs_dev(dev_t devno, const char *devname)
return NULL;
}
+ if (lstat(path, &stat0) < 0) {
+ /* When device node does not exist return fake entry.
+ * This may happen when i.e. lvm2 device dir != /dev */
+ log_debug("%s: Not available device node", path);
+ return &_fake_dev;
+ }
+
if (!(dev = _dev_create(devno)))
return_NULL;
7 years, 5 months
master - devcache: index devices also without udev
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=07a60b59f789e0...
Commit: 07a60b59f789e089761170f977defbd38defacef
Parent: 9e14abb887c5ac2a5a7446d08eb878a22eade051
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Apr 11 10:23:16 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Apr 11 10:32:19 2016 +0200
devcache: index devices also without udev
We have _insert_dirs() for udev and non-udev compilation.
Compiling without udev missed to call dev_cache_index_devs().
Move the call after _insert_dirs() call so both compilation
gets it.
---
WHATS_NEW | 4 ++++
lib/device/dev-cache.c | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index bf2972f..777c44e 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,3 +1,7 @@
+Version 2.02.151
+=================================
+ Detect device mismatch also when compiling without udev support.
+
Version 2.02.150 - 9th April 2016
=================================
Avoid using flushing dm status ioctl when checking for usable DM device.
diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index 8461f40..84471ab 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -999,8 +999,6 @@ static void _insert_dirs(struct dm_list *dirs)
log_debug_devs("%s: Failed to insert devices to "
"device cache fully", dl->dir);
}
-
- (void) dev_cache_index_devs();
}
#else /* UDEV_SYNC_SUPPORT */
@@ -1074,6 +1072,8 @@ static void _full_scan(int dev_scan)
_insert_dirs(&_cache.dirs);
+ (void) dev_cache_index_devs();
+
dm_list_iterate_items(dl, &_cache.files)
_insert_file(dl->dir);
7 years, 5 months
v2_02_150 annotated tag has been created
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=eadbe39b7a9017...
Commit: eadbe39b7a9017c63cec232c2f62717048f551f1
Parent: 0000000000000000000000000000000000000000
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: 2016-04-09 01:09 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: 2016-04-09 01:09 +0000
annotated tag: v2_02_150 has been created
at eadbe39b7a9017c63cec232c2f62717048f551f1 (tag)
tagging 3aab784aa5cbbe4f86cbc1c8a33579dc32c991eb (commit)
replaces v2_02_149
Release 2.02.150
A small bug-fix release.
24 files changed, 262 insertions(+), 139 deletions(-)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
iEYEABECAAYFAlcIVm4ACgkQIoGRwVZ+LBe1DQCgg02s7rQe1ll+DpzphKvqXTpw
GQIAn3X5HiuGNflwPFs28bBd3RGyXqmd
=FTsd
-----END PGP SIGNATURE-----
Alasdair G Kergon (6):
post-release
lvmdump: Allow dir to exist already if it is empty
lvmdump: If dir exists check dir perms too.
libdm: Correct typo.
activation: Skip another non-prefixed info ioctl.
pre-release
Marian Csontos (1):
test: Fix testing of installed lvmdbusd
Peter Rajnoha (3):
cleanup: use #define for field's quote and pair character and also for the error msg while extending output line
cleanup: use common init/destroy_processing_handle in _report fn and cleanup error paths
report: remove superfluous SEGSSTATUS report type
Zdenek Kabelac (17):
mirror: fix flushing for mirror target
suspend: fix suspend with noflush limitation
preload: preserve flushing state
libdm: improve debug message with ioctl
lvconvert: show percent with %.2
cleanup: indent
tests: verify repair of failing mirror
tests: do not break teardown on failing losetup
WHATS_NEW: update
lvcreate: %FREE -> %PVS
activation: do not check for devs without LVM-
tests: use mkfs.ext3
tests: require newer cache target
dev_manager: device_is_usable does not flush
cleanup: reuse _setup_task
cleanup: simplier to read condition
cleanup: avoid gcc warns
7 years, 5 months
master - post-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9e14abb887c5ac...
Commit: 9e14abb887c5ac2a5a7446d08eb878a22eade051
Parent: 3aab784aa5cbbe4f86cbc1c8a33579dc32c991eb
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Sat Apr 9 02:10:39 2016 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Sat Apr 9 02:10:39 2016 +0100
post-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/VERSION b/VERSION
index 78b4a66..4731ad0 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.150(2)-git (2016-04-09)
+2.02.151(2)-git (2016-04-09)
diff --git a/VERSION_DM b/VERSION_DM
index 8eb5316..359ada7 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.122-git (2016-04-09)
+1.02.123-git (2016-04-09)
7 years, 5 months
master - pre-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3aab784aa5cbbe...
Commit: 3aab784aa5cbbe4f86cbc1c8a33579dc32c991eb
Parent: af148a9d7715a8026d3d51a4c4c176bf59d3cc5f
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Sat Apr 9 02:08:44 2016 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Sat Apr 9 02:08:44 2016 +0100
pre-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 2 +-
WHATS_NEW_DM | 6 +++---
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/VERSION b/VERSION
index 3a2d7d1..78b4a66 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.150(2)-git (2016-04-01)
+2.02.150(2)-git (2016-04-09)
diff --git a/VERSION_DM b/VERSION_DM
index 77d3356..8eb5316 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.122-git (2016-04-01)
+1.02.122-git (2016-04-09)
diff --git a/WHATS_NEW b/WHATS_NEW
index 0fa9f50..bf2972f 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,4 +1,4 @@
-Version 2.02.150 -
+Version 2.02.150 - 9th April 2016
=================================
Avoid using flushing dm status ioctl when checking for usable DM device.
Check for devices without LVM- uuid prefix only with kernels < 3.X.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 6bd857e..08d7d45 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,6 +1,6 @@
-Version 1.02.122 -
-==================================
- Improve log_debug ioctl bit attrs.
+Version 1.02.122 - 9th April 2016
+=================================
+ Change log_debug ioctl flags from single characters into words.
Version 1.02.121 - 26th March 2016
==================================
7 years, 5 months
master - cleanup: avoid gcc warns
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=af148a9d7715a8...
Commit: af148a9d7715a8026d3d51a4c4c176bf59d3cc5f
Parent: 5cfa6cb347c5b7d8c5e3119b59bc7331388cb47e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Apr 8 11:36:02 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Apr 8 20:20:16 2016 +0200
cleanup: avoid gcc warns
Some older systems may had global declaration to cause gcc warning.
Rename for cases we don't care...
---
daemons/dmeventd/libdevmapper-event.c | 4 ++--
daemons/dmeventd/libdevmapper-event.h | 2 +-
lib/cache/lvmcache.c | 2 +-
lib/cache/lvmcache.h | 2 +-
lib/metadata/metadata-exported.h | 2 +-
5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/daemons/dmeventd/libdevmapper-event.c b/daemons/dmeventd/libdevmapper-event.c
index 871c0d6..d395ed3 100644
--- a/daemons/dmeventd/libdevmapper-event.c
+++ b/daemons/dmeventd/libdevmapper-event.c
@@ -855,9 +855,9 @@ int dm_event_get_version(struct dm_event_fifos *fifos, int *version) {
return 1;
}
-void dm_event_log_set(int debug_level, int use_syslog)
+void dm_event_log_set(int debug_log_level, int use_syslog)
{
- _debug_level = debug_level;
+ _debug_level = debug_log_level;
_use_syslog = use_syslog;
}
diff --git a/daemons/dmeventd/libdevmapper-event.h b/daemons/dmeventd/libdevmapper-event.h
index f9fb442..4c97223 100644
--- a/daemons/dmeventd/libdevmapper-event.h
+++ b/daemons/dmeventd/libdevmapper-event.h
@@ -106,7 +106,7 @@ int dm_event_register_handler(const struct dm_event_handler *dmevh);
int dm_event_unregister_handler(const struct dm_event_handler *dmevh);
/* Set debug level for logging, and whether to log on stdout/stderr or syslog */
-void dm_event_log_set(int debug_level, int use_syslog);
+void dm_event_log_set(int debug_log_level, int use_syslog);
/* Log messages acroding to current debug level */
__attribute__((format(printf, 6, 0)))
diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
index b1e53e2..394745a 100644
--- a/lib/cache/lvmcache.c
+++ b/lib/cache/lvmcache.c
@@ -1133,7 +1133,7 @@ struct device *lvmcache_device_from_pvid(struct cmd_context *cmd, const struct i
}
const char *lvmcache_pvid_from_devname(struct cmd_context *cmd,
- const char *devname)
+ const char *devname)
{
struct device *dev;
struct label *label;
diff --git a/lib/cache/lvmcache.h b/lib/cache/lvmcache.h
index 9ca0379..0ebbe07 100644
--- a/lib/cache/lvmcache.h
+++ b/lib/cache/lvmcache.h
@@ -108,7 +108,7 @@ const char *lvmcache_vgid_from_vgname(struct cmd_context *cmd, const char *vgnam
struct device *lvmcache_device_from_pvid(struct cmd_context *cmd, const struct id *pvid,
unsigned *scan_done_once, uint64_t *label_sector);
const char *lvmcache_pvid_from_devname(struct cmd_context *cmd,
- const char *dev_name);
+ const char *devname);
char *lvmcache_vgname_from_pvid(struct cmd_context *cmd, const char *pvid);
const char *lvmcache_vgname_from_info(struct lvmcache_info *info);
int lvmcache_vgs_locked(void);
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index ecca418..fb2ffa3 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -1061,7 +1061,7 @@ struct lv_segment *get_only_segment_using_this_lv(const struct logical_volume *l
* Useful functions for managing snapshots.
*/
int lv_is_origin(const struct logical_volume *lv);
-int lv_is_thin_origin(const struct logical_volume *lv, unsigned *snapshot_count);
+int lv_is_thin_origin(const struct logical_volume *lv, unsigned *snap_count);
int lv_is_cache_origin(const struct logical_volume *lv);
int lv_is_cow(const struct logical_volume *lv);
int lv_is_merging_cow(const struct logical_volume *cow);
7 years, 5 months
master - cleanup: simplier to read condition
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5cfa6cb347c5b7...
Commit: 5cfa6cb347c5b7d8c5e3119b59bc7331388cb47e
Parent: 74e704bb4465960b361711c890733cbae1f06e42
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Apr 8 19:34:56 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Apr 8 20:20:16 2016 +0200
cleanup: simplier to read condition
Make more readable what we are looking for and just test for
KERNEL version at one place.
---
lib/activate/dev_manager.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 8c01b43..3f91654 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -669,14 +669,15 @@ static int _original_uuid_format_check_required(struct cmd_context *cmd)
static int _kernel_major = 0;
if (!_kernel_major) {
- if ((sscanf(cmd->kernel_vsn, "%d", &_kernel_major) != 1))
- _kernel_major = 1;
- else if (_kernel_major >= MIN_KERNEL_MAJOR)
+ if ((sscanf(cmd->kernel_vsn, "%d", &_kernel_major) == 1) &&
+ (_kernel_major >= MIN_KERNEL_MAJOR))
log_debug_activation("Skipping checks for old devices without " UUID_PREFIX
" dm uuid prefix (kernel vsn %d >= %d).", _kernel_major, MIN_KERNEL_MAJOR);
+ else
+ _kernel_major = -1;
}
- return (_kernel_major < MIN_KERNEL_MAJOR);
+ return (_kernel_major == -1);
}
static int _info(struct cmd_context *cmd, const char *dlid, int with_open_count, int with_read_ahead,
7 years, 5 months