diff mbox

[3/6] libmultipath: improve debugging messages in sysfs_attr_set_value()

Message ID 1363270128-20900-4-git-send-email-hare@suse.de (mailing list archive)
State Deferred, archived
Headers show

Commit Message

Hannes Reinecke March 14, 2013, 2:08 p.m. UTC
We should be printing out debugging messages for all failure
cases in sysfs_attr_set_value().

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

Patch

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);