]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
get_features requires md_lock and snap_lock to be held
authorDan Mick <dan.mick@inktank.com>
Tue, 14 Aug 2012 22:30:48 +0000 (15:30 -0700)
committerDan Mick <dan.mick@inktank.com>
Sat, 18 Aug 2012 01:47:17 +0000 (18:47 -0700)
src/librbd/internal.cc

index cdac5a7388a06854a5e090ce8543fc354ddc94ee..7a799eaa70b46a93251864647461430cca9722a2 100644 (file)
@@ -515,14 +515,14 @@ namespace librbd {
       return r;
 
     uint64_t features;
+    Mutex::Locker l(ictx->md_lock);
+    Mutex::Locker l2(ictx->snap_lock);
     ictx->get_features(ictx->snap_id, &features);
     if ((features & RBD_FEATURE_LAYERING) == 0) {
       lderr(ictx->cct) << "snap_unprotect: image must support layering"
                       << dendl;
       return -ENOSYS;
     }
-    Mutex::Locker l(ictx->md_lock);
-    Mutex::Locker l2(ictx->snap_lock);
     snap_t snap_id = ictx->get_snap_id(snap_name);
     if (snap_id == CEPH_NOSNAP)
       return -ENOENT;