Skip to content

Commit

Permalink
rbd: drop dev registration check for new snap
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alex Elder committed Oct 1, 2012
1 parent 0f308a3 commit 86ff77b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 86ff77b

Please sign in to comment.