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:
parent
1102c4ee95
commit
b45b846449
@ -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).
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user