]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: Return EINVAL for parent lookup on root ino
authorJohn Spray <john.spray@inktank.com>
Thu, 13 Mar 2014 16:24:12 +0000 (16:24 +0000)
committerJohn Spray <john.spray@inktank.com>
Thu, 13 Mar 2014 18:30:55 +0000 (18:30 +0000)
This was the behaviour before 8d6b25a1, and distinguishes
the general failure to find a parent (ESTALE) from the specific
case of a node being present but being the base (EINVAL)

Signed-off-by: John Spray <john.spray@inktank.com>
src/mds/Server.cc

index a1327662d9b2212bc6e6596ee841dde9d8b6164e..4e46f976d8033db550624b33706d0a28f8a3b55c 100644 (file)
@@ -2401,6 +2401,10 @@ void Server::handle_client_lookup_ino(MDRequest *mdr, bool want_parent, bool wan
   }
 
   if (want_parent) {
+    if (in->is_base()) {
+      reply_request(mdr, -EINVAL);
+      return;
+    }
     if (!diri || diri->is_stray()) {
       reply_request(mdr, -ESTALE);
       return;