[dm-devel] [PATCH 3/6] libmultipath: improve debugging messages in sysfs_attr_set_value()

Hannes Reinecke hare at suse.de
Thu Mar 14 14:08:45 UTC 2013


We should be printing out debugging messages for all failure
cases in sysfs_attr_set_value().

Signed-off-by: Hannes Reinecke <hare at suse.de>
---
 libmultipath/sysfs.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libmultipath/sysfs.c b/libmultipath/sysfs.c
index d33747f..da228e4 100644
--- a/libmultipath/sysfs.c
+++ b/libmultipath/sysfs.c
@@ -58,12 +58,16 @@ ssize_t sysfs_attr_set_value(struct udev_device *dev, const char *attr_name,
 	}
 
 	/* skip directories */
-	if (S_ISDIR(statbuf.st_mode))
+	if (S_ISDIR(statbuf.st_mode)) {
+		condlog(4, "%s is a directory", devpath);
 		return 0;
+	}
 
 	/* skip non-writeable files */
-	if ((statbuf.st_mode & S_IWUSR) == 0)
+	if ((statbuf.st_mode & S_IWUSR) == 0) {
+		condlog(4, "%s is not writeable", devpath);
 		return 0;
+	}
 
 	/* write attribute value */
 	fd = open(devpath, O_WRONLY);
-- 
1.7.10.4




More information about the dm-devel mailing list