diff options
author | Moger, Babu <Babu.Moger@lsi.com> | 2010-04-09 14:30:40 -0600 |
---|---|---|
committer | Christophe Varoqui <christophe.varoqui@opensvc.com> | 2010-04-17 13:18:15 +0200 |
commit | e0cca4332f6299665b1a340735ebd62fddce9d23 (patch) | |
tree | c58df8f01ffdf91a9563e448de05a88027367044 | |
parent | 66288a8675e5b4d6ccc47ebfec8667cd9580ddfa (diff) | |
download | multipath-tools-e0cca4332f6299665b1a340735ebd62fddce9d23.tar.gz multipath-tools-e0cca4332f6299665b1a340735ebd62fddce9d23.tar.bz2 multipath-tools-e0cca4332f6299665b1a340735ebd62fddce9d23.zip |
multipath_tools: minor rdac message fix and code cleanup
This patch fixes a rdac minor message issue. rdac message is not passed in one of the path down cases. This patch fixes this problem. Also I have re-arranged the code for better readability.
Signed-off-by: Babu Moger <babu.moger@lsi.com>
Reviewed-by: Vijay Chauhan <Vijay.Chauhan@lsi.com>
-rw-r--r-- | libmultipath/checkers/rdac.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/libmultipath/checkers/rdac.c b/libmultipath/checkers/rdac.c index f9585d9..d12eed1 100644 --- a/libmultipath/checkers/rdac.c +++ b/libmultipath/checkers/rdac.c @@ -101,24 +101,32 @@ extern int libcheck_check (struct checker * c) { struct volume_access_inq inq; + int ret; memset(&inq, 0, sizeof(struct volume_access_inq)); if (0 != do_inq(c->fd, 0xC9, &inq, sizeof(struct volume_access_inq))) { - MSG(c, MSG_RDAC_DOWN); - return PATH_DOWN; - } else { - if ((inq.PQ_PDT & 0x20) || (inq.PQ_PDT & 0x7f)) { - /* LUN not connected*/ - return PATH_DOWN; - } + ret = PATH_DOWN; + goto done; + } else if ((inq.PQ_PDT & 0x20) || (inq.PQ_PDT & 0x7f)) { + /* LUN not connected*/ + ret = PATH_DOWN; + goto done; } - if (inq.avtcvp & 0x1) { + ret = ((inq.avtcvp & 0x1) ? PATH_UP : PATH_GHOST); + +done: + switch (ret) { + case PATH_DOWN: + MSG(c, MSG_RDAC_DOWN); + break; + case PATH_UP: MSG(c, MSG_RDAC_UP); - return PATH_UP; - } - else { + break; + case PATH_GHOST: MSG(c, MSG_RDAC_GHOST); - return PATH_GHOST; + break; } + + return ret; } |