[PATCH 30/30] libmultipath: read path state directly from sysfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The 'state' attribute of a SCSI device might change without
generating any udev events, so we need to read it directly
from sysfs.

Signed-off-by: Hannes Reinecke <hare@xxxxxxx>
---
 libmultipath/discovery.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index e2b4f56..7035a43 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -168,7 +168,6 @@ declare_sysfs_get_str(cutype);
 declare_sysfs_get_str(vendor);
 declare_sysfs_get_str(model);
 declare_sysfs_get_str(rev);
-declare_sysfs_get_str(state);
 declare_sysfs_get_str(dev);
 
 int
@@ -854,7 +853,8 @@ path_offline (struct path * pp)
 		return PATH_DOWN;
 	}
 
-	if (sysfs_get_state(parent, buff, SCSI_STATE_SIZE))
+	memset(buff, 0x0, SCSI_STATE_SIZE);
+	if (sysfs_attr_get_value(parent, "state", buff, SCSI_STATE_SIZE) <= 0)
 		return PATH_DOWN;
 
 	condlog(3, "%s: path state = %s", pp->dev, buff);
-- 
1.7.12.4

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux