]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: avoid potenial double get CDentry::PIN_SCRUBQUEUE
authorYan, Zheng <zyan@redhat.com>
Tue, 10 Nov 2015 13:36:40 +0000 (21:36 +0800)
committerYan, Zheng <zyan@redhat.com>
Tue, 10 Nov 2015 14:21:34 +0000 (22:21 +0800)
Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/mds/ScrubStack.cc

index a9480818faff1d41a3b946f831c725be08eb8263..f4ada6ed24b9337e4146dd14b5e95673bea020c2 100644 (file)
@@ -30,8 +30,8 @@ static ostream& _prefix(std::ostream *_dout, MDSRank *mds) {
 void ScrubStack::push_dentry(CDentry *dentry)
 {
   dout(20) << "pushing " << *dentry << " on top of ScrubStack" << dendl;
-  dentry->get(CDentry::PIN_SCRUBQUEUE);
   if (!dentry->item_scrub.is_on_list()) {
+    dentry->get(CDentry::PIN_SCRUBQUEUE);
     stack_size++;
   }
   dentry_stack.push_front(&dentry->item_scrub);
@@ -40,8 +40,8 @@ void ScrubStack::push_dentry(CDentry *dentry)
 void ScrubStack::push_dentry_bottom(CDentry *dentry)
 {
   dout(20) << "pushing " << *dentry << " on bottom of ScrubStack" << dendl;
-  dentry->get(CDentry::PIN_SCRUBQUEUE);
   if (!dentry->item_scrub.is_on_list()) {
+    dentry->get(CDentry::PIN_SCRUBQUEUE);
     stack_size++;
   }
   dentry_stack.push_back(&dentry->item_scrub);