aboutsummaryrefslogtreecommitdiff
path: root/drivers/block/rbd.c
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2012-09-24 21:02:47 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-17 08:51:20 -0800
commitf2ac87daff2e4a8c9fb8119a8e4badaac684a284 (patch)
treeaf032398fa986fabcd0007b69975ab3aa53c38c1 /drivers/block/rbd.c
parent50cda8f4439d715e080ced70d1e6d9ec07f95e6c (diff)
rbd: BUG on invalid layout
This shouldn't actually be possible because the layout struct is constructed from the RBD header and validated then. [elder@inktank.com: converted BUG() call to equivalent rbd_assert()] Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Alex Elder <elder@inktank.com> (based on commit 6cae3717cddaf8e5e96e304733dca66e40d56f89)
Diffstat (limited to 'drivers/block/rbd.c')
-rw-r--r--drivers/block/rbd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index cf3ce697c0b..f1375d98f6e 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -930,8 +930,9 @@ static int rbd_do_request(struct request *rq,
layout->fl_object_size = cpu_to_le32(1 << RBD_MAX_OBJ_ORDER);
layout->fl_pg_preferred = cpu_to_le32(-1);
layout->fl_pg_pool = cpu_to_le32(dev->poolid);
- ceph_calc_raw_layout(osdc, layout, snapid, ofs, &len, &bno,
- req, ops);
+ ret = ceph_calc_raw_layout(osdc, layout, snapid, ofs, &len, &bno,
+ req, ops);
+ BUG_ON(ret != 0);
ceph_osdc_build_request(req, ofs, &len,
ops,