Commit 86ff77bb authored by Alex Elder's avatar Alex Elder

rbd: drop dev registration check for new snap

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: default avatarAlex Elder <elder@inktank.com>
Reviewed-by: default avatarJosh Durgin <josh.durgin@inktank.com>
parent 0f308a31
...@@ -2258,8 +2258,8 @@ static int rbd_dev_snaps_register(struct rbd_device *rbd_dev) ...@@ -2258,8 +2258,8 @@ static int rbd_dev_snaps_register(struct rbd_device *rbd_dev)
int ret = 0; int ret = 0;
dout("%s called\n", __func__); dout("%s called\n", __func__);
if (!device_is_registered(&rbd_dev->dev)) if (WARN_ON(!device_is_registered(&rbd_dev->dev)))
return 0; return -EIO;
list_for_each_entry(snap, &rbd_dev->snaps, node) { list_for_each_entry(snap, &rbd_dev->snaps, node) {
if (!rbd_snap_registered(snap)) { if (!rbd_snap_registered(snap)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment