summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>2013-05-29 15:46:53 +0200
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>2013-05-31 19:15:23 +0200
commit0b78e2bcff368f5503aa9cd3662c1517655dea37 (patch)
tree1ff9a4b3657648a14709829ae99bf3c6e93a8ed2
parent578e292b74331ac8f4c2fcfd464edb7d83a6a02f (diff)
downloadceph-0b78e2bcff368f5503aa9cd3662c1517655dea37.tar.gz
mds/Migrator.cc: fix dereference after null check
Add asserts to check for 'dir' to fix: CID 716924 (#1-5 of 5): Dereference after null check (FORWARD_NULL) var_deref_model: Passing null pointer "dir" to function "operator <<(std::ostream &, CDir &)", which dereferences it. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
-rw-r--r--src/mds/Migrator.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mds/Migrator.cc b/src/mds/Migrator.cc
index 9fe5451432e..59d7d8ebfb8 100644
--- a/src/mds/Migrator.cc
+++ b/src/mds/Migrator.cc
@@ -414,11 +414,13 @@ void Migrator::handle_mds_failure_or_stop(int who)
break;
case IMPORT_LOGGINGSTART:
+ assert(dir);
dout(10) << "import state=loggingstart : reversing import on " << *dir << dendl;
import_reverse(dir);
break;
case IMPORT_ACKING:
+ assert(dir);
// hrm. make this an ambiguous import, and wait for exporter recovery to disambiguate
dout(10) << "import state=acking : noting ambiguous import " << *dir << dendl;
{
@@ -429,6 +431,7 @@ void Migrator::handle_mds_failure_or_stop(int who)
break;
case IMPORT_ABORTING:
+ assert(dir);
dout(10) << "import state=aborting : ignoring repeat failure " << *dir << dendl;
break;
}