summaryrefslogtreecommitdiff
path: root/src/cls_rgw.cc
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2012-09-12 16:41:17 -0700
committerYehuda Sadeh <yehuda@inktank.com>2012-09-18 13:30:40 -0700
commit92be908c7f22c0ccf2092024fd54096362032394 (patch)
treef51cfb0d471a51cc92d4ba90b63b27fb46e6389e /src/cls_rgw.cc
parentd3a8497b44296484fa18ac10e776c93701365a8b (diff)
downloadceph-92be908c7f22c0ccf2092024fd54096362032394.tar.gz
cls_rgw: change scoping of suggested changes vars
Fixes: #3127 Bad variable scoping made it so that specific variables weren't initialized between suggested changes iterations. This specifically affected a case where in a specific change we had an updated followed by a remove, and the remove was on a non-existent key (e.g., was already removed earlier). We ended up re-substracting the object stats, as the entry wasn't reset between the iterations (and we didn't read it because the key didn't exist). backport:argonaut Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Diffstat (limited to 'src/cls_rgw.cc')
-rw-r--r--src/cls_rgw.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/cls_rgw.cc b/src/cls_rgw.cc
index c46be4ad8c4..8523317d967 100644
--- a/src/cls_rgw.cc
+++ b/src/cls_rgw.cc
@@ -337,12 +337,11 @@ int rgw_dir_suggest_changes(cls_method_context_t hctx, bufferlist *in, bufferlis
}
bufferlist::iterator in_iter = in->begin();
- __u8 op;
- rgw_bucket_dir_entry cur_change;
- rgw_bucket_dir_entry cur_disk;
- bufferlist op_bl;
while (!in_iter.end()) {
+ __u8 op;
+ rgw_bucket_dir_entry cur_change;
+ rgw_bucket_dir_entry cur_disk;
try {
::decode(op, in_iter);
::decode(cur_change, in_iter);