aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/rbd.c
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2012-08-31 18:29:53 -0400
committerAlex Elder <elder@inktank.com>2012-10-01 15:30:52 -0400
commit86ff77bb68c6cda783b195a260f68fd5d32f7aaf (patch)
tree38c0f281df6e578171d39ad70d093afd10390dc7 /drivers/block/rbd.c
parent0f308a3188b37f36bc5a078f5fe039a41714476e (diff)
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: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'drivers/block/rbd.c')
-rw-r--r--drivers/block/rbd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 27988045b48e..fa99b94b9dbb 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -2258,8 +2258,8 @@ static int rbd_dev_snaps_register(struct rbd_device *rbd_dev)
2258 int ret = 0; 2258 int ret = 0;
2259 2259
2260 dout("%s called\n", __func__); 2260 dout("%s called\n", __func__);
2261 if (!device_is_registered(&rbd_dev->dev)) 2261 if (WARN_ON(!device_is_registered(&rbd_dev->dev)))
2262 return 0; 2262 return -EIO;
2263 2263
2264 list_for_each_entry(snap, &rbd_dev->snaps, node) { 2264 list_for_each_entry(snap, &rbd_dev->snaps, node) {
2265 if (!rbd_snap_registered(snap)) { 2265 if (!rbd_snap_registered(snap)) {