]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
FileStore: get_index prior to taking fdcache_lock in lfn_unlink
authorSamuel Just <sam.just@inktank.com>
Wed, 19 Jun 2013 22:11:28 +0000 (15:11 -0700)
committerSamuel Just <sam.just@inktank.com>
Wed, 19 Jun 2013 22:24:51 +0000 (15:24 -0700)
We take the fdcache_lock while holding onto index objects
elsewhere in the code.

Fixes: #5389
Reviewed-by: David Zafman <david.zafman@inktank.com>
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/os/FileStore.cc

index 8576032dccb80243524b6f27268f33f7d4c791f4..049539b73afee0dcb00d68c03d40a99219b24c44 100644 (file)
@@ -321,11 +321,11 @@ int FileStore::lfn_link(coll_t c, coll_t cid, const hobject_t& o)
 int FileStore::lfn_unlink(coll_t cid, const hobject_t& o,
                          const SequencerPosition &spos)
 {
-  Mutex::Locker l(fdcache_lock);
   Index index;
   int r = get_index(cid, &index);
   if (r < 0)
     return r;
+  Mutex::Locker l(fdcache_lock);
   {
     IndexedPath path;
     int exist;