]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: warn on dup inodes; don't crash
authorSage Weil <sage@newdream.net>
Wed, 23 Sep 2009 17:00:32 +0000 (10:00 -0700)
committerSage Weil <sage@newdream.net>
Wed, 23 Sep 2009 16:59:37 +0000 (09:59 -0700)
We just ignore the second instance of the inode.  It can get
cleaned up transparently if/when the directory gets saved.

src/mds/CDir.cc

index 58982d1faad3ac61d7f7e12f9be5de6c3ae41861..5a2908c5d7b46f5696afdbb0a18c976ce7351103 100644 (file)
@@ -1227,10 +1227,18 @@ void CDir::_fetched(bufferlist &bl)
        CInode *in = 0;
        if (cache->have_inode(inode.ino, last)) {
          in = cache->get_inode(inode.ino, last);
-         dout(-12) << "_fetched  got (but i already had) " << *in 
+         dout(-12) << "_fetched  badness: got (but i already had) " << *in 
                   << " mode " << in->inode.mode 
                   << " mtime " << in->inode.mtime << dendl;
-         assert(0);  // this shouldn't happen!! 
+         stringstream ss;
+         string dirpath, inopath;
+         this->inode->make_path_string(dirpath);
+         in->make_path_string(inopath);
+         ss << "loaded dup inode " << inode.ino << " [" << first << "," << last << "] v" << inode.version
+            << " at " << dirpath << "/" << dname
+            << ", but inode " << in->vino() << " v" << in->inode.version << " already exists at " << inopath;
+         cache->mds->logclient.log(LOG_ERROR, ss);
+         continue;
        } else {
          // inode
          in = new CInode(cache, true, first, last);