]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/MDCache.cc: fix dereference null return value
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 29 May 2013 13:24:39 +0000 (15:24 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 31 May 2013 17:15:23 +0000 (19:15 +0200)
Add assert to fix:

CID 716994 (#1 of 1): Dereference null return value (NULL_RETURNS)
  dereference: Dereferencing a pointer that might be null "dir" when
  calling "CDir::mark_dirty(version_t, LogSegment *)".

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/mds/MDCache.cc

index 330e69507d96c9e522526a026314f36248df0bdc..8c17172e5c48ad8846cab505118f825970ee8dff 100644 (file)
@@ -496,6 +496,7 @@ void MDCache::_create_system_file_finish(Mutation *mut, CDentry *dn, version_t d
   CDir *dir = 0;
   if (in->inode.is_dir()) {
     dir = in->get_dirfrag(frag_t());
+    assert(dir);
     dir->mark_dirty(1, mut->ls);
     dir->mark_new(mut->ls);
   }