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,12 +1,13 @@
Version 2.02.29 - Version 2.02.29 -
================================== ==================================
Include strerror string in dev_open_flags' stat failure message.
Move guts of pvresize into library. Move guts of pvresize into library.
Avoid error when --corelog is provided without --mirrorlog. (2.02.28) Avoid error when --corelog is provided without --mirrorlog. (2.02.28)
Correct --mirrorlog argument name in man pages (not --log). Correct --mirrorlog argument name in man pages (not --log).
Clear MIRROR_NOTSYNCED LV flag when converting from mirror to linear. Clear MIRROR_NOTSYNCED LV flag when converting from mirror to linear.
Modify lvremove to prompt for removal if LV active on other cluster nodes. Modify lvremove to prompt for removal if LV active on other cluster nodes.
Add '-f' to vgremove to force removal of VG even if LVs exist. Add '-f' to vgremove to force removal of VG even if LVs exist.
Version 2.02.28 - 24th August 2007 Version 2.02.28 - 24th August 2007
================================== ==================================
Fix clvmd logging so you can get lvm-level debugging out of it. Fix clvmd logging so you can get lvm-level debugging out of it.

View File

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