master - libdaemon: Print a diagnostic when we fail to lock the pidfile.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=dce8d06af7e5a1...
Commit: dce8d06af7e5a14a1507bea0e64e6cc27556cbc7
Parent: 9495a3d807b890f7a639e5761b2b37ba495b5d9b
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Mon Apr 15 09:43:30 2013 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Mon Apr 15 16:07:07 2013 +0200
libdaemon: Print a diagnostic when we fail to lock the pidfile.
---
libdaemon/server/daemon-server.c | 18 +++++++++++++-----
1 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
index 735a0ea..1db7ca7 100644
--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -52,6 +52,8 @@ static void _exit_handler(int sig __attribute__((unused)))
_shutdown_requested = 1;
}
+#define EXIT_ALREADYRUNNING 13
+
#ifdef linux
#include <stddef.h>
@@ -261,7 +263,7 @@ static void remove_lockfile(const char *file)
perror("unlink failed");
}
-static void _daemonise(void)
+static void _daemonise(daemon_state s)
{
int child_status;
int fd;
@@ -296,8 +298,14 @@ static void _daemonise(void)
if (_shutdown_requested) /* Child has signaled it is ok - we can exit now */
exit(0);
- /* Problem with child. Determine what it is by exit code */
- fprintf(stderr, "Child exited with code %d\n", WEXITSTATUS(child_status));
+ switch (WEXITSTATUS(child_status)) {
+ case EXIT_ALREADYRUNNING:
+ fprintf(stderr, "Failed to acquire lock on %s. Already running?\n", s.pidfile);
+ break;
+ default:
+ /* Problem with child. Determine what it is by exit code */
+ fprintf(stderr, "Child exited with code %d\n", WEXITSTATUS(child_status));
+ }
exit(WEXITSTATUS(child_status));
}
@@ -464,7 +472,7 @@ void daemon_start(daemon_state s)
#endif
if (!s.foreground)
- _daemonise();
+ _daemonise(s);
s.log = &_log;
s.log->name = s.name;
@@ -481,7 +489,7 @@ void daemon_start(daemon_state s)
* after this point.
*/
if (dm_create_lockfile(s.pidfile) == 0)
- exit(1);
+ exit(EXIT_ALREADYRUNNING);
(void) dm_prepare_selinux_context(NULL, 0);
}
10 years, 11 months
master - Revert "cleanup: simplify option matching function"
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9495a3d807b890...
Commit: 9495a3d807b890f7a639e5761b2b37ba495b5d9b
Parent: c363c74a251a5745e8ac6e274d1f7a1e32fa1843
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Sat Apr 13 02:26:37 2013 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Sat Apr 13 02:26:37 2013 +0100
Revert "cleanup: simplify option matching function"
This reverts commit 0396ade38b88431d959ce02fac689306a2c47786.
The original code also handled len==1, which the new code doesn't.
Press <TAB> in the lvm shell to get a list of the possible
flag completions for a single hyphen.
---
tools/lvm.c | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/tools/lvm.c b/tools/lvm.c
index 9b66516..ebce811 100644
--- a/tools/lvm.c
+++ b/tools/lvm.c
@@ -91,11 +91,18 @@ static char *_list_args(const char *text, int state)
return NULL;
/* Short form arguments */
- if (len == 2 && text[0] == '-') {
- while (match_no < com->num_args)
- if (text[1] == (_cmdline->arg_props +
- com->valid_args[match_no++])->short_arg)
- return strdup(text);
+ if (len < 3) {
+ while (match_no < com->num_args) {
+ char s[3];
+ char c;
+ if (!(c = (_cmdline->arg_props +
+ com->valid_args[match_no++])->short_arg))
+ continue;
+
+ sprintf(s, "-%c", c);
+ if (!strncmp(text, s, len))
+ return strdup(s);
+ }
}
/* Long form arguments */
10 years, 11 months
master - CLEAN-UP: Better string checking to avoid substring matches
by Jonathan Brassow
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c363c74a251a57...
Commit: c363c74a251a5745e8ac6e274d1f7a1e32fa1843
Parent: 58734d2538854ef79e6605ba69c57723737d12c2
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Fri Apr 12 11:30:04 2013 -0500
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Fri Apr 12 11:30:04 2013 -0500
CLEAN-UP: Better string checking to avoid substring matches
Commit 9fd7ac7d035f0b2f8dcc3cb19935eb181816bd76 introduced a way a
method of avoiding reading from mirrors with a device failure. If
a device was found to be dead, the mapping table was checked for
'handle_errors' or 'block_on_error'. These strings were checked for
in the table string via 'strstr', which could also match on strings
like, 'no_handle_errors' or 'no_block_on_error'. No such strings
exist, but we don't want to have problems in the future if they do.
So, we check for ' <string>{'\0'|' '}'.
---
lib/activate/dev_manager.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 8c06476..00c0126 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -239,7 +239,7 @@ static int _ignore_blocked_mirror_devices(struct device *dev,
dev_t log_dev;
char *images_health, *log_health;
uint64_t s,l;
- char *params, *target_type = NULL;
+ char *p, *params, *target_type = NULL;
void *next = NULL;
struct dm_task *dmt = NULL;
int r = 0;
@@ -306,8 +306,10 @@ static int _ignore_blocked_mirror_devices(struct device *dev,
if (strcmp(target_type, "mirror"))
goto_out;
- if (strstr(params, "block_on_error") ||
- strstr(params, "handle_errors")) {
+ if (((p = strstr(params, " block_on_error")) &&
+ (p[15] == '\0' || p[15] == ' ')) ||
+ ((p = strstr(params, " handle_errors")) &&
+ (p[14] == '\0' || p[14] == ' '))) {
log_debug_activation("%s: I/O blocked to mirror device",
dev_name(dev));
goto out;
10 years, 11 months
master - dmsetup: check for strncpy
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=58734d2538854e...
Commit: 58734d2538854ef79e6605ba69c57723737d12c2
Parent: a81a2406f18c6ad0802a02892214f56b1bb99c13
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Feb 10 18:34:12 2012 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Apr 12 11:30:47 2013 +0200
dmsetup: check for strncpy
Test whether device name fits into a given buffer.
---
tools/dmsetup.c | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index ce46d6c..8f6b340 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -3244,20 +3244,19 @@ static char *parse_loop_device_name(const char *dev, const char *dev_dir)
device[strlen(dev_dir)] != '/')
goto error;
- strncpy(buf, strrchr(device, '/') + 1, PATH_MAX - 1);
- buf[PATH_MAX - 1] = '\0';
+ if (!dm_strncpy(buf, strrchr(device, '/') + 1, PATH_MAX))
+ goto error;
dm_free(device);
-
} else {
/* check for device number */
- if (!strncmp(dev, "loop", strlen("loop")))
- strncpy(buf, dev, (size_t) PATH_MAX);
- else
+ if (strncmp(dev, "loop", sizeof("loop") - 1))
+ goto error;
+
+ if (!dm_strncpy(buf, dev, PATH_MAX))
goto error;
}
return buf;
-
error:
dm_free(device);
dm_free(buf);
10 years, 11 months
master - tools: add common lv_change_activate
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a81a2406f18c6a...
Commit: a81a2406f18c6ad0802a02892214f56b1bb99c13
Parent: 698137ec38a3582954543685bffb1e937ab61c34
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Apr 11 13:51:08 2013 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Apr 12 11:30:07 2013 +0200
tools: add common lv_change_activate
Move common code for changing activation state from
vgchange and lvchange to one function.
Fix the order of checks - so we always implicitelly
activate snapshots and thin volumes in exclusive mode,
and we do not allow local deactivation for them.
---
WHATS_NEW | 1 +
tools/lvchange.c | 42 +++++-------------------------------------
tools/toollib.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
tools/toollib.h | 2 ++
tools/vgchange.c | 33 +++------------------------------
5 files changed, 56 insertions(+), 67 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 11e838e..31c33fe 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.99 -
===================================
+ Add lv_change_activate() for common activation code in vg/lvchange.
Revert change that allowed identical table reload for RAID.
New lvchange arg, '--syncaction' allows scrubbing of RAID LVs.
Improve RAID kernel status retrieval to include sync_action/mismatch_cnt.
diff --git a/tools/lvchange.c b/tools/lvchange.c
index e19e2e7..834ae0f 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -219,44 +219,12 @@ static int _lvchange_activate(struct cmd_context *cmd, struct logical_volume *lv
if (lv_is_cow(lv) && !lv_is_virtual_origin(origin_from_cow(lv)))
lv = origin_from_cow(lv);
- if (activate == CHANGE_AAY) {
- if (!lv_passes_auto_activation_filter(cmd, lv))
- return 1;
- activate = CHANGE_ALY;
- }
-
- if (activate == CHANGE_ALN) {
- log_verbose("Deactivating logical volume \"%s\" locally",
- lv->name);
- if (!deactivate_lv_local(cmd, lv))
- return_0;
- } else if (activate == CHANGE_AN) {
- log_verbose("Deactivating logical volume \"%s\"", lv->name);
- if (!deactivate_lv(cmd, lv))
- return_0;
- } else {
- if ((activate == CHANGE_AE) ||
- lv_is_origin(lv) ||
- lv_is_thin_type(lv)) {
- log_verbose("Activating logical volume \"%s\" "
- "exclusively", lv->name);
- if (!activate_lv_excl(cmd, lv))
- return_0;
- } else if (activate == CHANGE_ALY) {
- log_verbose("Activating logical volume \"%s\" locally",
- lv->name);
- if (!activate_lv_local(cmd, lv))
- return_0;
- } else {
- log_verbose("Activating logical volume \"%s\"",
- lv->name);
- if (!activate_lv(cmd, lv))
- return_0;
- }
+ if ((activate == CHANGE_AAY) &&
+ !lv_passes_auto_activation_filter(cmd, lv))
+ return 1;
- if (background_polling())
- lv_spawn_background_polling(cmd, lv);
- }
+ if (!lv_change_activate(cmd, lv, activate))
+ return_0;
return 1;
}
diff --git a/tools/toollib.c b/tools/toollib.c
index f00988a..950ca33 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -1296,6 +1296,51 @@ int vgcreate_params_set_from_args(struct cmd_context *cmd,
return 1;
}
+/* Shared code for changing activation state for vgchange/lvchange */
+int lv_change_activate(struct cmd_context *cmd, struct logical_volume *lv,
+ activation_change_t activate)
+{
+ if (activate == CHANGE_AN) {
+ log_verbose("Deactivating logical volume \"%s\"", lv->name);
+ if (!deactivate_lv(cmd, lv))
+ return_0;
+ return 1;
+ } else if ((activate == CHANGE_AE) ||
+ lv_is_origin(lv) ||
+ lv_is_thin_type(lv)) {
+ if (activate == CHANGE_ALN) {
+ /* origin or thin, all others have _AE */
+ /* other types of activation are implicitly exclusive */
+ /* Note: the order of tests is mandatory */
+ log_error("Cannot deactivate \"%s\" locally.", lv->name);
+ return 0;
+ }
+ log_verbose("Activating logical volume \"%s\" exclusively.", lv->name);
+ if (!activate_lv_excl(cmd, lv))
+ return_0;
+ } else if (activate == CHANGE_ALN) {
+ log_verbose("Deactivating logical volume \"%s\" locally.", lv->name);
+ if (!deactivate_lv_local(cmd, lv))
+ return_0;
+ return 1;
+ } else if ((activate == CHANGE_ALY) || (activate == CHANGE_AAY)) {
+ log_verbose("Activating logical volume \"%s\" locally.", lv->name);
+ if (!activate_lv_local(cmd, lv))
+ return_0;
+ } else { /* CHANGE_AY */
+ log_verbose("Activating logical volume \"%s\".", lv->name);
+ if (!activate_lv(cmd, lv))
+ return_0;
+ }
+
+ /* CHANGE_AN/ALN is not getting here */
+ if (background_polling() &&
+ (lv->status & (PVMOVE|CONVERTING|MERGING)))
+ lv_spawn_background_polling(cmd, lv);
+
+ return 1;
+}
+
int lv_refresh(struct cmd_context *cmd, struct logical_volume *lv)
{
int r = 0;
diff --git a/tools/toollib.h b/tools/toollib.h
index 2ca7951..d2fd9ac 100644
--- a/tools/toollib.h
+++ b/tools/toollib.h
@@ -101,6 +101,8 @@ void vgcreate_params_set_defaults(struct vgcreate_params *vp_def,
int vgcreate_params_set_from_args(struct cmd_context *cmd,
struct vgcreate_params *vp_new,
struct vgcreate_params *vp_def);
+int lv_change_activate(struct cmd_context *cmd, struct logical_volume *lv,
+ activation_change_t activate);
int lv_refresh(struct cmd_context *cmd, struct logical_volume *lv);
int vg_refresh_visible(struct cmd_context *cmd, struct volume_group *vg);
void lv_spawn_background_polling(struct cmd_context *cmd,
diff --git a/tools/vgchange.c b/tools/vgchange.c
index ccf31da..5c0a6fc 100644
--- a/tools/vgchange.c
+++ b/tools/vgchange.c
@@ -131,44 +131,17 @@ static int _activate_lvs_in_vg(struct cmd_context *cmd, struct volume_group *vg,
continue;
}
- if (activate == CHANGE_AAY && !lv_passes_auto_activation_filter(cmd, lv))
+ if ((activate == CHANGE_AAY) &&
+ !lv_passes_auto_activation_filter(cmd, lv))
continue;
expected_count++;
- if (activate == CHANGE_AN) {
- if (!deactivate_lv(cmd, lv)) {
- stack;
- continue;
- }
- } else if (activate == CHANGE_ALN) {
- if (!deactivate_lv_local(cmd, lv)) {
- stack;
- continue;
- }
- } else if ((activate == CHANGE_AE) ||
- lv_is_origin(lv) ||
- lv_is_thin_type(lv)) {
- /* FIXME: duplicated test code with lvchange */
- if (!activate_lv_excl(cmd, lv)) {
- stack;
- continue;
- }
- } else if (activate == CHANGE_AAY || activate == CHANGE_ALY) {
- if (!activate_lv_local(cmd, lv)) {
- stack;
- continue;
- }
- } else if (!activate_lv(cmd, lv)) {
+ if (!lv_change_activate(cmd, lv, activate)) {
stack;
continue;
}
- if (background_polling() &&
- activate != CHANGE_AN && activate != CHANGE_ALN &&
- (lv->status & (PVMOVE|CONVERTING|MERGING)))
- lv_spawn_background_polling(cmd, lv);
-
count++;
}
10 years, 11 months
master - cleanup: add gcc attribute for printf parameter
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=698137ec38a358...
Commit: 698137ec38a3582954543685bffb1e937ab61c34
Parent: 2e39392daf1de9c61052edc991f30bda352612c9
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Apr 11 13:49:13 2013 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Apr 12 11:26:31 2013 +0200
cleanup: add gcc attribute for printf parameter
---
libdm/libdevmapper.h | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h
index 172976f..b3ba24d 100644
--- a/libdm/libdevmapper.h
+++ b/libdm/libdevmapper.h
@@ -1341,7 +1341,8 @@ int dm_fclose(FILE *stream);
*/
int dm_asprintf(char **buf, const char *format, ...)
__attribute__ ((format(printf, 2, 3)));
-int dm_vasprintf(char **buf, const char *format, va_list ap);
+int dm_vasprintf(char **buf, const char *format, va_list ap)
+ __attribute__ ((format(printf, 2, 0)));
/*
* create lockfile (pidfile) - create and lock a lock file
10 years, 11 months
master - cleanup: remove unused lvl_idx
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2e39392daf1de9...
Commit: 2e39392daf1de9c61052edc991f30bda352612c9
Parent: 4cce09dbdbf1fdb8e6ca985144fdeb181c3a480b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Apr 11 13:48:23 2013 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Apr 12 11:26:31 2013 +0200
cleanup: remove unused lvl_idx
---
lib/metadata/raid_manip.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index b1ada5c..43cf14e 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -1896,7 +1896,7 @@ try_again:
int lv_raid_remove_missing(struct logical_volume *lv)
{
- uint32_t s, lvl_idx;
+ uint32_t s;
struct lv_segment *seg = first_seg(lv);
struct cmd_context *cmd = lv->vg->cmd;
@@ -1913,7 +1913,7 @@ int lv_raid_remove_missing(struct logical_volume *lv)
* FIXME: Make sure # of compromised components will not affect RAID
*/
- for (s = 0, lvl_idx = 0; s < seg->area_count; s++) {
+ for (s = 0; s < seg->area_count; s++) {
if (!(seg_lv(seg, s)->status & PARTIAL_LV) &&
!(seg_metalv(seg, s)->status & PARTIAL_LV))
continue;
10 years, 11 months
master - lvmcache: keep sp_count unsigned
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4cce09dbdbf1fd...
Commit: 4cce09dbdbf1fdb8e6ca985144fdeb181c3a480b
Parent: 719e908bc010455fc14589d941b949c5f3c92806
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Apr 11 13:46:47 2013 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Apr 12 11:26:31 2013 +0200
lvmcache: keep sp_count unsigned
---
lib/format_pool/disk_rep.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/format_pool/disk_rep.c b/lib/format_pool/disk_rep.c
index c4afefe..899a48d 100644
--- a/lib/format_pool/disk_rep.c
+++ b/lib/format_pool/disk_rep.c
@@ -242,7 +242,7 @@ struct _read_pool_pv_baton {
struct dm_list *head;
const char *vgname;
uint32_t *sp_devs;
- int sp_count;
+ uint32_t sp_count;
int failed;
int empty;
};
10 years, 11 months
master - WHATS_NEW: Add WHATS_NEW entry for previous commit.
by Jonathan Brassow
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=719e908bc01045...
Commit: 719e908bc010455fc14589d941b949c5f3c92806
Parent: faeea370571b6525d9d95d2904aaacbdb9552e00
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Thu Apr 11 16:03:24 2013 -0500
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Thu Apr 11 16:03:24 2013 -0500
WHATS_NEW: Add WHATS_NEW entry for previous commit.
---
WHATS_NEW | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 43c39d6..11e838e 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.99 -
===================================
+ Revert change that allowed identical table reload for RAID.
New lvchange arg, '--syncaction' allows scrubbing of RAID LVs.
Improve RAID kernel status retrieval to include sync_action/mismatch_cnt.
Add external origin support for lvcreate.
10 years, 11 months
master - RAID: Revert previous commit that allowed identical table loads.
by Jonathan Brassow
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=faeea370571b65...
Commit: faeea370571b6525d9d95d2904aaacbdb9552e00
Parent: ff64e3500f6acf93dce017388445c4828111d06f
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Thu Apr 11 15:57:14 2013 -0500
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Thu Apr 11 15:57:14 2013 -0500
RAID: Revert previous commit that allowed identical table loads.
Revert commit 31c24dd9f2ad7b5f7913a18c9f11a00d7b3474a1. This commit
was used to force a RAID device-mapper table to be loaded into the
kernel despite the fact that it was identical to the one already
loaded. The effect allowed a RAID array with a transiently failed
device to refresh and reintegrate the failed device. This operation
is better done in the kernel on a 'resume'. Since,
'lvchange --refresh' already performs a suspend/resume cycle, the
above commit is not needed once the kernel change is made. Reverting
the commit removes an unnecessary (at least for now) change to the
device-mapper interface.
---
lib/raid/raid.c | 15 ---------------
libdm/libdevmapper.h | 3 +--
libdm/libdm-deptree.c | 20 +-------------------
3 files changed, 2 insertions(+), 36 deletions(-)
diff --git a/lib/raid/raid.c b/lib/raid/raid.c
index 69b6ee3..1e28c73 100644
--- a/lib/raid/raid.c
+++ b/lib/raid/raid.c
@@ -161,7 +161,6 @@ static int _raid_add_target_line(struct dev_manager *dm __attribute__((unused)),
uint32_t s;
uint64_t flags = 0;
uint64_t rebuilds = 0;
- char *raid_health = NULL;
if (!seg->area_count) {
log_error(INTERNAL_ERROR "_raid_add_target_line called "
@@ -191,20 +190,6 @@ static int _raid_add_target_line(struct dev_manager *dm __attribute__((unused)),
if (mirror_in_sync())
flags = DM_NOSYNC;
- /*
- * If the RAID LV is not 'PARTIAL' and the status indicates
- * that the array has failed devices, it means that the
- * failed devices have returned and can be reintegrated.
- *
- * We reload the (potentially identical) table to force the
- * kernel to re-read the RAID superblocks - possibly restoring
- * transiently failed devices.
- */
- if (!(seg->lv->status & PARTIAL_LV) &&
- lv_raid_dev_health(seg->lv, &raid_health) &&
- strchr(raid_health, 'D'))
- dm_tree_node_force_identical_table_reload(node);
-
if (!dm_tree_node_add_raid_target(node, len, _raid_name(seg),
seg->region_size, seg->stripe_size,
rebuilds, flags))
diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h
index 2f2c77d..172976f 100644
--- a/libdm/libdevmapper.h
+++ b/libdm/libdevmapper.h
@@ -501,14 +501,13 @@ struct dm_tree_node *dm_tree_next_child(void **handle,
uint32_t inverted);
/*
- * Get and set properties of a node.
+ * Get properties of a node.
*/
const char *dm_tree_node_get_name(const struct dm_tree_node *node);
const char *dm_tree_node_get_uuid(const struct dm_tree_node *node);
const struct dm_info *dm_tree_node_get_info(const struct dm_tree_node *node);
void *dm_tree_node_get_context(const struct dm_tree_node *node);
int dm_tree_node_size_changed(const struct dm_tree_node *dnode);
-int dm_tree_node_force_identical_table_reload(struct dm_tree_node *dnode);
/*
* Returns the number of children of the given node (excluding the root node).
diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c
index 750f494..9f82174 100644
--- a/libdm/libdm-deptree.c
+++ b/libdm/libdm-deptree.c
@@ -232,16 +232,6 @@ struct load_properties {
/* Send messages for this node in preload */
unsigned send_messages;
-
- /*
- * If a mapping table is replacing an existing identical table,
- * the load is suppressed by default - avoiding the construction
- * of an unnecessary in-kernel table. Sometimes we want to avoid
- * this optimization and load the identical table anyway. This
- * field is used to indicate that we desire identical tables to be
- * loaded and not suppressed.
- */
- unsigned force_identical_table_reload;
};
/* Two of these used to join two nodes with uses and used_by. */
@@ -597,13 +587,6 @@ int dm_tree_node_size_changed(const struct dm_tree_node *dnode)
return dnode->props.size_changed;
}
-int dm_tree_node_force_identical_table_reload(struct dm_tree_node *dnode)
-{
- dnode->props.force_identical_table_reload = 1;
- return 1;
-}
-
-
int dm_tree_node_num_children(const struct dm_tree_node *node, uint32_t inverted)
{
if (inverted) {
@@ -2426,8 +2409,7 @@ static int _load_node(struct dm_tree_node *dnode)
seg, &seg_start))
goto_out;
- if (!dnode->props.force_identical_table_reload &&
- !dm_task_suppress_identical_reload(dmt))
+ if (!dm_task_suppress_identical_reload(dmt))
log_error("Failed to suppress reload of identical tables.");
if ((r = dm_task_run(dmt))) {
10 years, 11 months