rbd: warn on update_snaps failure on notify
authorSage Weil <sage@newdream.net>
Thu, 12 May 2011 23:08:30 +0000 (16:08 -0700)
committerSage Weil <sage@newdream.net>
Thu, 19 May 2011 18:25:05 +0000 (11:25 -0700)
Signed-off-by: Sage Weil <sage@newdream.net>
drivers/block/rbd.c

index 9712fad82bc6cf2be78daaa503432e8725ab2a4f..78d0011a755621cfe9a8ec7cd3c3eb4fa93042ca 100644 (file)
@@ -1191,14 +1191,19 @@ static int rbd_req_sync_notify_ack(struct rbd_device *dev,
 static void rbd_watch_cb(u64 ver, u64 notify_id, u8 opcode, void *data)
 {
        struct rbd_device *dev = (struct rbd_device *)data;
+       int rc;
+
        if (!dev)
                return;
 
        dout("rbd_watch_cb %s notify_id=%lld opcode=%d\n", dev->obj_md_name,
                notify_id, (int)opcode);
        mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
-       __rbd_update_snaps(dev);
+       rc = __rbd_update_snaps(dev);
        mutex_unlock(&ctl_mutex);
+       if (rc)
+               pr_warning(DRV_NAME "%d got notification but failed to update"
+                          " snaps: %d\n", dev->major, rc);
 
        rbd_req_sync_notify_ack(dev, ver, notify_id, dev->obj_md_name);
 }