]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: avoid useless have_inode() call
authorSage Weil <sage@inktank.com>
Sat, 29 Sep 2012 08:06:38 +0000 (01:06 -0700)
committerSage Weil <sage@inktank.com>
Sat, 29 Sep 2012 08:06:38 +0000 (01:06 -0700)
CID 716989: Dereference null return value (NULL_RETURNS)
At (83): Dereferencing a pointer that might be null "in" when calling "operator <<(std::ostream &, CInode &)". [hide details]

Signed-off-by: Sage Weil <sage@inktank.com>
src/mds/CDir.cc

index 6761c6ffffd56cb168ac25b47a2545e9fb5c0e65..066dc6adb79d8cf6b4896a5062b8d85a2c079556 100644 (file)
@@ -1536,9 +1536,8 @@ void CDir::_fetched(bufferlist &bl, const string& want_dn)
         }
       } else {
        // add inode
-       CInode *in = 0;
-       if (cache->have_inode(inode.ino, last)) {
-         in = cache->get_inode(inode.ino, last);
+       CInode *in = cache->get_inode(inode.ino, last);
+       if (in) {
          dout(0) << "_fetched  badness: got (but i already had) " << *in
                  << " mode " << in->inode.mode
                  << " mtime " << in->inode.mtime << dendl;