]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
uclient: path_walk should notice when it gets absolute paths.
authorGreg Farnum <gregory.farnum@dreamhost.com>
Wed, 15 Jun 2011 21:24:43 +0000 (14:24 -0700)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Wed, 15 Jun 2011 21:24:43 +0000 (14:24 -0700)
Previously it assumed everything was relative, but we need to handle
absolute paths on occasion, and already have the code to do so!

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/client/Client.cc

index ecc41f33bb04c80c2d88ef5f81eb70c0c4312e9a..b521d4eecc9fbe14cd0070e43103548384b40b96 100644 (file)
@@ -3382,7 +3382,11 @@ int Client::get_or_create(Inode *dir, const char* name,
 int Client::path_walk(const filepath& origpath, Inode **final, bool followsym)
 {
   filepath path = origpath;
-  Inode *cur = cwd;
+  Inode *cur;
+  if (origpath.absolute())
+    cur = root;
+  else
+    cur = cwd;
   assert(cur);
 
   dout(10) << "path_walk " << path << dendl;