]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix a race
authorYehuda Sadeh <yehuda@redhat.com>
Mon, 5 Jun 2017 17:05:24 +0000 (10:05 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 5 Jun 2017 20:18:04 +0000 (13:18 -0700)
We referred to complete_op_data after aio call that could have released
it.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_rados.cc

index 2866323583a04666199780b774100d01a2cb7e60..da976f1eb025a922d58484057abac1d8d5091dbd 100644 (file)
@@ -12535,8 +12535,9 @@ int RGWRados::cls_obj_complete_op(BucketShard& bs, const rgw_obj& obj, RGWModify
   complete_op_data *arg;
   index_completion_manager->create_completion(obj, op, tag, ver, key, dir_meta, remove_objs,
                                               get_zone().log_data, bilog_flags, _zones_trace, &arg);
+  librados::AioCompletion *completion = arg->rados_completion;
   int ret = bs.index_ctx.aio_operate(bs.bucket_obj, arg->rados_completion, &o);
-  arg->rados_completion->release();
+  completion->release(); /* can't reference arg here, as it might have already been released */
   return ret;
 }