From: Samuel Just Date: Mon, 18 May 2015 19:29:05 +0000 (-0700) Subject: DBObjectMap::sync: add comment clarifying locking X-Git-Tag: v9.0.2~135^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2eca53682fb1c4e9bb1c0c75c53886857a672624;p=ceph.git DBObjectMap::sync: add comment clarifying locking Signed-off-by: Samuel Just --- diff --git a/src/os/DBObjectMap.cc b/src/os/DBObjectMap.cc index b85684984865..ae67e4d7d6a7 100644 --- a/src/os/DBObjectMap.cc +++ b/src/os/DBObjectMap.cc @@ -1043,6 +1043,13 @@ int DBObjectMap::sync(const ghobject_t *oid, header->spos = *spos; set_map_header(hl, *oid, *header, t); } + /* It may appear that this and the identical portion of the else + * block can combined below, but in this block, the transaction + * must be submitted under *both* the MapHeaderLock and the full + * header_lock. + * + * See 2b63dd25fc1c73fa42e52e9ea4ab5a45dd9422a0 and bug 9891. + */ Mutex::Locker l(header_lock); write_state(t); return db->submit_transaction_sync(t);