]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
fixed readdir path crash
authorsageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Sun, 18 Nov 2007 06:05:48 +0000 (06:05 +0000)
committersageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Sun, 18 Nov 2007 06:05:48 +0000 (06:05 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@2078 29311d96-e01e-0410-9327-a35deaab8ce9

trunk/ceph/client/Client.cc
trunk/ceph/client/Client.h

index cad6af279c56103bc9a81e99e8522950577641a0..c259b0208e3215b4400d3cc2cba3f171b9f29566 100644 (file)
@@ -2207,11 +2207,11 @@ int Client::opendir(const char *name, DIR **dirpp)
 
 int Client::_opendir(const char *name, DirResult **dirpp) 
 {
-  *dirpp = new DirResult(name);
+  filepath path(name, 1);   // FIXME: always relative to root, for now.
+  *dirpp = new DirResult(path);
 
   // do we have the inode in our cache?  
   // if so, should be we ask for a different dirfrag?
-  filepath path(name);
   Dentry *dn = lookup(path);
   if (dn && dn->inode) {
     (*dirpp)->inode = dn->inode;
@@ -2302,7 +2302,7 @@ int Client::_readdir_get_frag(DirResult *dirp)
   dout(10) << "_readdir_get_frag " << dirp << " on " << dirp->path << " fg " << fg << dendl;
 
   MClientRequest *req = new MClientRequest(MDS_OP_READDIR, messenger->get_myinst());
-  req->set_path(dirp->path); 
+  req->set_filepath(dirp->path); 
   req->head.args.readdir.frag = fg;
   
   // FIXME where does FUSE maintain user information
index 64c09afc68b55807cccb5179b5a9df32364d5c04..f7e093868d588f9ecc0202a086ff55904c4153a3 100644 (file)
@@ -383,15 +383,12 @@ class Client : public Dispatcher {
     static const int64_t MASK = (1 << SHIFT) - 1;
     static const off_t END = 1ULL << (SHIFT + 32);
 
-    string path;
+    filepath path;
     Inode *inode;
     int64_t offset;   // high bits: frag_t, low bits: an offset
     map<frag_t, vector<DirEntry> > buffer;
 
-    DirResult(const char *p, Inode *in=0) : path(p), inode(in), offset(0) { 
-      if (inode) inode->get();
-    }
-    DirResult(const string &p, Inode *in=0) : path(p), inode(in), offset(0) { 
+    DirResult(const filepath &fp, Inode *in=0) : path(fp), inode(in), offset(0) { 
       if (inode) inode->get();
     }