rbd: drop dev registration check for new snap
authorAlex Elder <elder@inktank.com>
Fri, 31 Aug 2012 22:29:53 +0000 (17:29 -0500)
committerAlex Elder <elder@inktank.com>
Mon, 1 Oct 2012 19:30:52 +0000 (14:30 -0500)
By the time rbd_dev_snaps_register() gets called during rbd device
initialization, the main device will have already been registered.
Similarly, a header refresh will only occur for an rbd device whose
Linux device is registered.  There is therefore no need to verify
the main device is registered when registering a snapshot device.

For the time being, turn the check into a WARN_ON(), but it can
eventually just go away.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
drivers/block/rbd.c

index 27988045b48e97ab103238887b8175956e1f83fa..fa99b94b9dbb633479633d55c0ccb1f57a2d2a56 100644 (file)
@@ -2258,8 +2258,8 @@ static int rbd_dev_snaps_register(struct rbd_device *rbd_dev)
        int ret = 0;
 
        dout("%s called\n", __func__);
-       if (!device_is_registered(&rbd_dev->dev))
-               return 0;
+       if (WARN_ON(!device_is_registered(&rbd_dev->dev)))
+               return -EIO;
 
        list_for_each_entry(snap, &rbd_dev->snaps, node) {
                if (!rbd_snap_registered(snap)) {