All of lore.kernel.org
 help / color / mirror / Atom feed
From: Henry C Chang <henry_c_chang@tcloudcomputing.com>
To: Thomas Mueller <thomas@chaschperli.ch>
Cc: ceph-devel@vger.kernel.org
Subject: Re: cmds segfault on pdj-fstest (ceph.git unstable)
Date: Thu, 10 Jun 2010 19:38:14 +0800	[thread overview]
Message-ID: <AANLkTikoEestUHujD0_TcG0haFOcOX4pYPVodpr6NOKF@mail.gmail.com> (raw)
In-Reply-To: <huqcjt$khk$1@dough.gmane.org>

>
>    add checks for being a snapshot root to dir_is_nonempty
>
> :040000 040000 6c45c68b84800b105299133374f0f91d82948659 2c1b290125ae435679ab29d6fbab7f5b8f81e4b9 M      src
>

I also got this segfault today. The segfault is caused by:
_dir_is_nonempty() has already done reply_request(), but the caller,
handle_client_unlink(), did it again.

I suggest to move out reply_request() from _dir_is_nonempty(), and
leave it to the caller.
Maybe as below:

Henry


===========================================
diff --git a/src/mds/Server.cc b/src/mds/Server.cc
index 29d0a32..4a90f4e 100644
--- a/src/mds/Server.cc
+++ b/src/mds/Server.cc
@@ -3976,7 +3976,6 @@ bool Server::_dir_is_nonempty(MDRequest *mdr, CInode *in)
               << dir->inode->get_projected_inode()->dirstat.size()
               << " on " << *dir->inode
               << dendl;
-      reply_request(mdr, -ENOTEMPTY);
       return true;
     }

@@ -4070,8 +4069,10 @@ void Server::handle_client_rename(MDRequest *mdr)
     }

     // non-empty dir?
-    if (oldin->is_dir() && _dir_is_nonempty(mdr, oldin))
+    if (oldin->is_dir() && _dir_is_nonempty(mdr, oldin)) {
+      reply_request(mdr, -ENOTEMPTY);
       return;
+    }
   }

   // -- some sanity checks --

  reply	other threads:[~2010-06-10 11:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-09  6:48 cmds segfault on pdj-fstest (ceph.git unstable) Thomas Mueller
2010-06-10  9:51 ` Thomas Mueller
2010-06-10 11:38   ` Henry C Chang [this message]
2010-06-10 16:11     ` Gregory Farnum
2010-06-10 16:26       ` Gregory Farnum
2010-06-11  2:17         ` Henry C Chang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTikoEestUHujD0_TcG0haFOcOX4pYPVodpr6NOKF@mail.gmail.com \
    --to=henry_c_chang@tcloudcomputing.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=thomas@chaschperli.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.