]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
osd/ReplicatedPG: check obs.exists for CEPH_OSD_OP_CMPXATTR/SRC_CMPXATTR. 5961/head
authorJianpeng Ma <jianpeng.ma@intel.com>
Fri, 18 Dec 2015 15:48:04 +0000 (23:48 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Fri, 18 Dec 2015 15:48:04 +0000 (23:48 +0800)
commit7794bc4d68f6caf83b3e3ff1ec819ea9ea0d1232
treea4565b2e436de1d3180948d15629e1a176c1c65f
parent0f0c76b74c2eb41e892d58afac177ab624fcee4a
osd/ReplicatedPG: check obs.exists for  CEPH_OSD_OP_CMPXATTR/SRC_CMPXATTR.

We may use those ops(CMPXATTR, WRITE, SET_XATTR) to do a write. Using
CMPXATTR to indiate whether to write. But if object don't exist, because
the ops is writeable(because WRITE, SET_XATTR), so it can do CMPXATTR.
But at this situation, the func getattr_maybe_cache return -ENOENT.
For optimization, we first check obs.exists.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/osd/ReplicatedPG.cc