1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-23 21:35:29 +03:00

Check lv_info() success

Add log_error message for lv_info failure and exit from futher
processing.

Replace 'leg' occurence in debug message with 'image' which
is used in other messages.
This commit is contained in:
Zdenek Kabelac 2010-12-01 13:01:36 +00:00
parent 966bfcef27
commit 7837f37e21
2 changed files with 12 additions and 3 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.78 -
====================================
Check lv_info() success in _mirrored_transient_status().
Add backtraces for dev_set() and dev_close_immediate() errors in set_lv().
Add logging for unlink() error in clvmd remove_lockfile().
Add logging for pipe write() and close() error in clvmd child_init_signal().

View File

@ -291,7 +291,11 @@ static int _mirrored_transient_status(struct lv_segment *seg, char *params)
if (!strcmp(log_args[0], "disk")) {
char buf[32];
log = first_seg(lv)->log_lv;
lv_info(lv->vg->cmd, log, 0, &info, 0, 0);
if (!lv_info(lv->vg->cmd, log, 0, &info, 0, 0)) {
log_error("Check for existence of mirror log %s failed.",
log->name);
return 0;
}
log_debug("Found mirror log at %d:%d", info.major, info.minor);
sprintf(buf, "%d:%d", info.major, info.minor);
if (strcmp(buf, log_args[1])) {
@ -311,8 +315,12 @@ static int _mirrored_transient_status(struct lv_segment *seg, char *params)
for (i = 0; i < seg->area_count; ++i) {
char buf[32];
lv_info(lv->vg->cmd, seg_lv(seg, i), 0, &info, 0, 0);
log_debug("Found mirror leg at %d:%d", info.major, info.minor);
if (!lv_info(lv->vg->cmd, seg_lv(seg, i), 0, &info, 0, 0)) {
log_error("Check for existence of mirror image %s failed.",
seg_lv(seg, i)->name);
return 0;
}
log_debug("Found mirror image at %d:%d", info.major, info.minor);
sprintf(buf, "%d:%d", info.major, info.minor);
for (j = 0; j < num_devs; ++j) {
if (!strcmp(buf, args[j])) {