1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

Include strerror string in dev_open_flags' stat failure message.

* lib/device/dev-io.c (dev_open_flags):
Use log_sys_error after failed stat to report strerror(errno).
Use a slightly different diagnostic to report mismatched device number.
This commit is contained in:
Jim Meyering 2007-09-07 11:24:19 +00:00
parent 1102c4ee95
commit b45b846449
2 changed files with 11 additions and 5 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.29 -
==================================
Include strerror string in dev_open_flags' stat failure message.
Move guts of pvresize into library.
Avoid error when --corelog is provided without --mirrorlog. (2.02.28)
Correct --mirrorlog argument name in man pages (not --log).

View File

@ -359,11 +359,16 @@ int dev_open_flags(struct device *dev, int flags, int direct, int quiet)
return 0;
}
if (!(dev->flags & DEV_REGULAR) &&
((stat(name, &buf) < 0) || (buf.st_rdev != dev->dev))) {
log_error("%s: stat failed: Has device name changed?", name);
if (!(dev->flags & DEV_REGULAR)) {
if (stat(name, &buf) < 0) {
log_sys_error("%s: stat failed", name);
return 0;
}
if (buf.st_rdev != dev->dev) {
log_error("%s: device changed", name);
return 0;
}
}
#ifdef O_DIRECT_SUPPORT
if (direct) {