]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mdstore readdir bugfix
authorsage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Tue, 5 Jul 2005 03:00:08 +0000 (03:00 +0000)
committersage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Tue, 5 Jul 2005 03:00:08 +0000 (03:00 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@392 29311d96-e01e-0410-9327-a35deaab8ce9

ceph/mds/MDStore.cc

index 2eaf772e2bc07ae038b73b6142475ae561754dfe..a05a787354527ab06f7278b642e6196d478f9ae9 100644 (file)
@@ -535,6 +535,8 @@ class MDDoFetchDirContext : public Context {
        size_t size;
        bl.copy(0, sizeof(size_t), (char*)&size);
        size_t got = bl.length() - sizeof(size);
+       size_t left = size - got;
+       size_t from = bl.length();
 
        if (got >= size) {
          // done.
@@ -542,14 +544,14 @@ class MDDoFetchDirContext : public Context {
        }
        else {
          // read the rest!
-         cout << "do_fetch_dir_2 dir size is " << size << ", got " << got << ", reading rest" << endl;
+         cout << "do_fetch_dir_2 dir size is " << size << ", got " << got << ", reading remaniing " << left << " from off " << from << endl;
          
          // create return context
          MDDoFetchDirContext *fin = new MDDoFetchDirContext( mds, ino, context, hashcode );
          fin->bl.claim( bl );
          mds->filer->read(ino,
                                           g_OSD_MDDirLayout,
-                                          size - got, bl.length(),
+                                          left, from,
                                           &fin->bl2,
                                           fin );
          return;