mds/Migrator.cc: fix possible NULL pointer dereference

Move dout() calls behind the related asserts to prevent possible NULL
pointer dereference.

CID 717001 (#1 of 1): Dereference null return value (NULL_RETURNS)
  dereference: Dereferencing a pointer that might be null "diri" when calling
  "operator <<(std::ostream &, CInode

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
This commit is contained in:
Danny Al-Gaaf 2013-05-22 17:06:40 +02:00
parent 5110497e31
commit de1e355360

View File

@ -378,20 +378,20 @@ void Migrator::handle_mds_failure_or_stop(int who)
break;
case IMPORT_DISCOVERED:
dout(10) << "import state=discovered : unpinning inode " << *diri << dendl;
assert(diri);
dout(10) << "import state=discovered : unpinning inode " << *diri << dendl;
import_reverse_discovered(df, diri);
break;
case IMPORT_PREPPING:
dout(10) << "import state=prepping : unpinning base+bounds " << *dir << dendl;
assert(dir);
dout(10) << "import state=prepping : unpinning base+bounds " << *dir << dendl;
import_reverse_prepping(dir);
break;
case IMPORT_PREPPED:
dout(10) << "import state=prepped : unpinning base+bounds, unfreezing " << *dir << dendl;
assert(dir);
dout(10) << "import state=prepped : unpinning base+bounds, unfreezing " << *dir << dendl;
{
set<CDir*> bounds;
cache->get_subtree_bounds(dir, bounds);