aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2012-10-11 00:19:13 -0400
committerAlex Elder <elder@inktank.com>2012-10-26 18:18:08 -0400
commitb213e0b1a62637b2a9395a34349b13d73ca2b90a (patch)
treee096a1d0b33102ed8e433da468b45e0a9eede1c4 /drivers/block
parentb000056a5a8d3f5a4a9fb80184a7ec14f86a43d4 (diff)
rbd: fix bug in rbd_dev_id_put()
In rbd_dev_id_put(), there's a loop that's intended to determine the maximum device id in use. But it isn't doing that at all, the effect of how it's written is to simply use the just-put id number, which ignores whole purpose of this function. Fix the bug. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'drivers/block')
-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 8f56d37637a7..4a16464ad5bb 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -2680,8 +2680,8 @@ static void rbd_dev_id_put(struct rbd_device *rbd_dev)
2680 struct rbd_device *rbd_dev; 2680 struct rbd_device *rbd_dev;
2681 2681
2682 rbd_dev = list_entry(tmp, struct rbd_device, node); 2682 rbd_dev = list_entry(tmp, struct rbd_device, node);
2683 if (rbd_id > max_id) 2683 if (rbd_dev->dev_id > max_id)
2684 max_id = rbd_id; 2684 max_id = rbd_dev->dev_id;
2685 } 2685 }
2686 spin_unlock(&rbd_dev_list_lock); 2686 spin_unlock(&rbd_dev_list_lock);
2687 2687