ctdb-recoverd: Check if callback function is registered before calling
authorAmitay Isaacs <amitay@gmail.com>
Thu, 27 Feb 2014 01:41:23 +0000 (12:41 +1100)
committerMartin Schwenke <martins@samba.org>
Thu, 27 Feb 2014 12:54:59 +0000 (13:54 +0100)
Fix suggested by by Kevin Osborn <kosborn@overlandstorage.com>.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Feb 27 13:54:59 CET 2014 on sn-devel-104

ctdb/server/ctdb_takeover.c

index 6b60fea7bf574406f9d7644d5ad2d42c277de712..fe4f472078caa70b14d95244fe550af55d41a37a 100644 (file)
@@ -2578,8 +2578,13 @@ static void iprealloc_fail_callback(struct ctdb_context *ctdb, uint32_t pnn,
                /* If the control timed out then that's a real error,
                 * so call the real fail callback
                 */
-               cd->fail_callback(ctdb, pnn, res, outdata,
-                                 cd->fail_callback_data);
+               if (cd->fail_callback) {
+                       cd->fail_callback(ctdb, pnn, res, outdata,
+                                         cd->fail_callback_data);
+               } else {
+                       DEBUG(DEBUG_WARNING,
+                             ("iprealloc timed out but no callback registered\n"));
+               }
                break;
        default:
                /* If not a timeout then either the ipreallocated