From b45b84644977e2c08534711a330b0b70a04a2150 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 7 Sep 2007 11:24:19 +0000 Subject: [PATCH] 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. --- WHATS_NEW | 3 ++- lib/device/dev-io.c | 13 +++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 7fd5eca8c..81f0f583d 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,12 +1,13 @@ 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). Clear MIRROR_NOTSYNCED LV flag when converting from mirror to linear. 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. - + Version 2.02.28 - 24th August 2007 ================================== Fix clvmd logging so you can get lvm-level debugging out of it. diff --git a/lib/device/dev-io.c b/lib/device/dev-io.c index 94069032e..54ae88e58 100644 --- a/lib/device/dev-io.c +++ b/lib/device/dev-io.c @@ -359,10 +359,15 @@ 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); - return 0; + 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