mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-31 21:18:26 +03:00
debug: more tracing
Check result of device_ids_write() and at least provide stack;
This commit is contained in:
parent
d01c17ff22
commit
75037bee5d
@ -689,7 +689,8 @@ int device_ids_write(struct cmd_context *cmd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((dir_fd = open(dirpath, O_RDONLY)) < 0) {
|
if ((dir_fd = open(dirpath, O_RDONLY)) < 0) {
|
||||||
fclose(fp);
|
if (fclose(fp))
|
||||||
|
log_sys_debug("fclose", tmpfile);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@ -782,9 +783,10 @@ static void _device_ids_update_try(struct cmd_context *cmd)
|
|||||||
if (!lock_devices_file_try(cmd, LOCK_EX, &held)) {
|
if (!lock_devices_file_try(cmd, LOCK_EX, &held)) {
|
||||||
log_debug("Skip devices file update (busy).");
|
log_debug("Skip devices file update (busy).");
|
||||||
} else {
|
} else {
|
||||||
if (device_ids_version_unchanged(cmd))
|
if (device_ids_version_unchanged(cmd)) {
|
||||||
device_ids_write(cmd);
|
if (!device_ids_write(cmd))
|
||||||
else
|
stack;
|
||||||
|
} else
|
||||||
log_debug("Skip devices file update (changed).");
|
log_debug("Skip devices file update (changed).");
|
||||||
}
|
}
|
||||||
if (!held)
|
if (!held)
|
||||||
|
@ -582,7 +582,8 @@ retry_open:
|
|||||||
|
|
||||||
if (di == -1) {
|
if (di == -1) {
|
||||||
log_error("Failed to set bcache fd.");
|
log_error("Failed to set bcache fd.");
|
||||||
close(fd);
|
if (close(fd))
|
||||||
|
log_sys_debug("close", name);
|
||||||
dev->bcache_fd = -1;
|
dev->bcache_fd = -1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1592,7 +1593,8 @@ int label_scan_reopen_rw(struct device *dev)
|
|||||||
if (!bcache_change_fd(dev->bcache_di, fd)) {
|
if (!bcache_change_fd(dev->bcache_di, fd)) {
|
||||||
log_error("Failed to change to rw fd %s di %d fd %d.",
|
log_error("Failed to change to rw fd %s di %d fd %d.",
|
||||||
dev_name(dev), dev->bcache_di, fd);
|
dev_name(dev), dev->bcache_di, fd);
|
||||||
close(fd);
|
if (close(fd))
|
||||||
|
log_sys_debug("close", dev_name(dev));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5770,7 +5770,8 @@ do_command:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: when vgcreate uses only existing PVs this doesn't change and can be skipped */
|
/* TODO: when vgcreate uses only existing PVs this doesn't change and can be skipped */
|
||||||
device_ids_write(cmd);
|
if (!device_ids_write(cmd))
|
||||||
|
stack;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Don't keep devs open excl in bcache because the excl will prevent
|
* Don't keep devs open excl in bcache because the excl will prevent
|
||||||
|
Loading…
Reference in New Issue
Block a user