aboutsummaryrefslogtreecommitdiff
path: root/drivers/block/rbd.c
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2012-10-10 21:19:13 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-17 08:51:20 -0800
commit1e411c66732294f5fb983323dafa7559796481f5 (patch)
treed8484130164320be04a32550b57f154b25bb862c /drivers/block/rbd.c
parentf2ac87daff2e4a8c9fb8119a8e4badaac684a284 (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> (cherry picked from commit b213e0b1a62637b2a9395a34349b13d73ca2b90a) Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 f1375d98f6e..d9ebe6844da 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -2150,8 +2150,8 @@ static void rbd_id_put(struct rbd_device *rbd_dev)
struct rbd_device *rbd_dev;
rbd_dev = list_entry(tmp, struct rbd_device, node);
- if (rbd_id > max_id)
- max_id = rbd_id;
+ if (rbd_dev->id > max_id)
+ max_id = rbd_dev->id;
}
spin_unlock(&rbd_dev_list_lock);