dm_is_suspended returns non-null if it failed to obtain the device
information. It's wrong to assume in this case that the device is suspended.

Signed-off-by: Martin Wilck <[email protected]>
---
 libmultipath/devmapper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c
index e653ca6..e9a0103 100644
--- a/libmultipath/devmapper.c
+++ b/libmultipath/devmapper.c
@@ -604,7 +604,7 @@ int dm_addmap_reload(struct multipath *mpp, char *params, 
int flush)
        /* If the resume failed, dm will leave the device suspended, and
         * drop the new table, so doing a second resume will try using
         * the original table */
-       if (dm_is_suspended(mpp->alias))
+       if (dm_is_suspended(mpp->alias) == 1)
                dm_simplecmd(DM_DEVICE_RESUME, mpp->alias,
                             DMFL_NEED_SYNC | (flush ? 0 : DMFL_NO_FLUSH),
                             udev_flags);
-- 
2.45.2


Reply via email to