diff options
author | Sage Weil <sage@inktank.com> | 2013-09-20 20:43:00 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-09-20 20:43:00 -0700 |
commit | 59ee51aff71fc3fdba9562f19a9a7ce2263524b6 (patch) | |
tree | 3cc4cf0a2c72361f4268837559e0360fd1f9e347 | |
parent | 08a97ae45f4df58a6a8ea8a6400934d860cf5eb4 (diff) | |
download | ceph-59ee51aff71fc3fdba9562f19a9a7ce2263524b6.tar.gz |
osd/ReplicatedPG: handle COPY_FROM self
Return EINVAL if we try to COPY_FROM ourselves.
Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r-- | src/osd/ReplicatedPG.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index a92403ae370..a48372fe561 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -3532,6 +3532,11 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops) hobject_t src(src_name, src_oloc.key, src_snapid, raw_pg.ps(), raw_pg.pool(), src_oloc.nspace); + if (src == soid) { + dout(20) << " copy from self is invalid" << dendl; + result = -EINVAL; + break; + } result = start_copy(ctx, src, src_oloc, src_version, &ctx->copy_op); if (result < 0) goto fail; |