]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: lookup . on non-directory inode 21003/head
authorJos Collin <jcollin@redhat.com>
Thu, 22 Mar 2018 07:28:48 +0000 (12:58 +0530)
committerJos Collin <jcollin@redhat.com>
Thu, 22 Mar 2018 07:32:00 +0000 (13:02 +0530)
Fixes: https://tracker.ceph.com/issues/23210
Signed-off-by: Jos Collin <jcollin@redhat.com>
src/client/Client.cc

index a6ca8f4cd7ff17f3725d305985df42f9bea8c8cd..d05db0f76e408fb971833fb64ef7452dfcfc1efc 100644 (file)
@@ -6085,11 +6085,6 @@ int Client::_lookup(Inode *dir, const string& dname, int mask, InodeRef *target,
   int r = 0;
   Dentry *dn = NULL;
 
-  if (!dir->is_dir()) {
-    r = -ENOTDIR;
-    goto done;
-  }
-
   if (dname == "..") {
     if (dir->dentries.empty()) {
       MetaRequest *req = new MetaRequest(CEPH_MDS_OP_LOOKUPPARENT);
@@ -6118,6 +6113,11 @@ int Client::_lookup(Inode *dir, const string& dname, int mask, InodeRef *target,
     goto done;
   }
 
+  if (!dir->is_dir()) {
+    r = -ENOTDIR;
+    goto done;
+  }
+
   if (dname.length() > NAME_MAX) {
     r = -ENAMETOOLONG;
     goto done;