diff options
author | Sage Weil <sage@newdream.net> | 2012-05-04 12:09:28 -0700 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2012-05-04 12:09:28 -0700 |
commit | f3760da4feb02a5b25794615ad67f07b3e1370b9 (patch) | |
tree | 1e6b8629356c8b2a6ab8b03ebfab1df8d79bdbde | |
parent | e0a636f90701620670e747571cc7ad27efac958f (diff) | |
download | ceph-f3760da4feb02a5b25794615ad67f07b3e1370b9.tar.gz |
crush: update_item() should pass an error back to the caller
If you give it a nonsensical loc, it will fail check_item_loc() (false) and
then error out on insert_item().
Reported-by: Sam Just <sam.just@inktank.com>
Signed-off-by: Sage Weil <sage@newdream.net>
-rw-r--r-- | src/crush/CrushWrapper.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index 74cd752a718..85e072615c4 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -208,9 +208,9 @@ int CrushWrapper::update_item(CephContext *cct, int item, float weight, string n } ldout(cct, 5) << "update_item adding " << item << " weight " << weight << " at " << loc << dendl; - int r = insert_item(cct, item, weight, name.c_str(), loc); - if (r == 0) - ret = 1; + ret = insert_item(cct, item, weight, name.c_str(), loc); + if (ret == 0) + ret = 1; // changed } return ret; } |