Skip to content

Commit

Permalink
client: don't request lookup parent if ino is root
Browse files Browse the repository at this point in the history
Signed-off-by: huanwen ren <[email protected]>
  • Loading branch information
renhwztetecs committed Dec 16, 2016
1 parent 70e7969 commit 9d925e0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/client/Client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7963,6 +7963,12 @@ int Client::lookup_parent(Inode *ino, const UserPerm& perms, Inode **parent)
ldout(cct, 3) << "lookup_parent dentry already present" << dendl;
return 0;
}

if (ino->is_root()) {
*parent = NULL;
ldout(cct, 3) << "ino is root, no parent" << dendl;
return -EINVAL;
}

MetaRequest *req = new MetaRequest(CEPH_MDS_OP_LOOKUPPARENT);
filepath path(ino->ino);
Expand Down

0 comments on commit 9d925e0

Please sign in to comment.