From: root Date: Mon, 26 Sep 2005 09:32:46 +0000 (+0200) Subject: [libmultipath] don't trust the path wwid from cache if pathinfo() fails X-Git-Tag: 0.4.6~110 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a9b6732578cc6e09afb7e8c2450cd02d84fca827;p=platform%2Fupstream%2Fmultipath-tools.git [libmultipath] don't trust the path wwid from cache if pathinfo() fails This kept the reduced map from loading when multipathd runs and a path is failed or offline. Also fix get_claimed() false positive returns by checking errno == EBUSY --- diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index 449a253..3558b00 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -225,7 +225,7 @@ get_claimed(char * devname) { int fd = opennode(devname, O_EXCL); - if (fd < 0) + if (fd <= 0 && errno == EBUSY) return 1; close(fd); @@ -670,8 +670,9 @@ pathinfo (struct path *pp, vector hwtable, int mask) out: /* * Recoverable error, for example faulty or offline path - * Force path state to "failed" + * Set up safe defaults, don't trust the cache */ + memset(pp->wwid, 0, WWID_SIZE); pp->state = PATH_DOWN; return 0; }