]> sourceware.org Git - lvm2.git/commitdiff
Fix return code of info callbacks.
authorMilan Broz <mbroz@redhat.com>
Tue, 26 Jan 2010 07:58:23 +0000 (07:58 +0000)
committerMilan Broz <mbroz@redhat.com>
Tue, 26 Jan 2010 07:58:23 +0000 (07:58 +0000)
In dev_manager_info 0 means error and 1 info is returned,
not that device exists (that value is part of info struct).

Fix query by uuid only (no name) which returns 0 when device
does not exist.

WHATS_NEW
lib/activate/dev_manager.c

index 7b944f4289c98752bfae046ae66620a7d7a328bf..e8c35a8fabc8c33c3192b08b2d0a263c9184bd49 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.60 - 23rd January 2010
 ===================================
+  Fix return code of info call for query by uuid.
   Extend cmirrord man page.
   Sleep before first progress check if pvmove/lvconvert interval has prefix '+'.
   Default to checking progress before waiting in _wait_for_single_lv.
index 25b7a100271573a8799733d11477e577cbcb08e0..60235747c36d75ac4912c15836b6371647d841fb 100644 (file)
@@ -209,14 +209,16 @@ static int _info(const char *name, const char *dlid, int mknodes,
                 int with_open_count, int with_read_ahead,
                 struct dm_info *info, uint32_t *read_ahead)
 {
+       int r = 0;
+
        if (!mknodes && dlid && *dlid) {
-               if (_info_run(NULL, dlid, info, read_ahead, 0, with_open_count,
-                             with_read_ahead, 0, 0) &&
+               if ((r = _info_run(NULL, dlid, info, read_ahead, 0, with_open_count,
+                             with_read_ahead, 0, 0)) &&
                    info->exists)
                        return 1;
-               else if (_info_run(NULL, dlid + sizeof(UUID_PREFIX) - 1, info,
+               else if ((r = _info_run(NULL, dlid + sizeof(UUID_PREFIX) - 1, info,
                                   read_ahead, 0, with_open_count,
-                                  with_read_ahead, 0, 0) &&
+                                  with_read_ahead, 0, 0)) &&
                         info->exists)
                        return 1;
        }
@@ -225,7 +227,7 @@ static int _info(const char *name, const char *dlid, int mknodes,
                return _info_run(name, NULL, info, read_ahead, mknodes,
                                 with_open_count, with_read_ahead, 0, 0);
 
-       return 0;
+       return r;
 }
 
 static int _info_by_dev(uint32_t major, uint32_t minor, struct dm_info *info)
This page took 0.053479 seconds and 5 git commands to generate.