File multipath-tools-always-refresh-sysfs-device of Package multipath-tools

commit c40c7129e79986fd4d6b6b34f2296ead6baf3f96
Author: Hannes Reinecke <hare@suse.de>
Date:   Wed Jan 28 11:00:02 2009 +0100

    Always refresh the sysfs device before calling get_state()
    
    get_state() requires the sysfs device; however, this can be
    invalid if it's being deleted. So better refresh it to make
    sure we have a valid pointer.
    
    Signed-off-by: Hannes Reinecke <hare@suse.de>

diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index b56899a..cccd30d 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -800,7 +800,8 @@ get_state (struct path * pp)
 
 	condlog(3, "%s: get_state", pp->dev);
 
-	if (pp->bus == SYSFS_BUS_SCSI && pp->sysdev) {
+	if (pp->bus == SYSFS_BUS_SCSI) {
+		pp->sysdev = sysfs_device_from_path(pp);
 		/* Check the sdev state before accessing it */
 		state = sysfs_get_sdev_state(pp);
 		if (state == PATH_PENDING || state == PATH_DOWN) {
openSUSE Build Service is sponsored by