]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
DBObjectMap::sync: add comment clarifying locking 4720/head
authorSamuel Just <sjust@redhat.com>
Mon, 18 May 2015 19:29:05 +0000 (12:29 -0700)
committerSamuel Just <sjust@redhat.com>
Mon, 18 May 2015 19:29:05 +0000 (12:29 -0700)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/os/DBObjectMap.cc

index b8568498486566fcea48e0ba7c992d786cce1376..ae67e4d7d6a7d109044b28f47c7fb5cf513fda30 100644 (file)
@@ -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);