summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Lang <sam.lang@inktank.com>2013-04-12 11:08:35 -0500
committerGreg Farnum <greg@inktank.com>2013-04-16 09:04:42 -0700
commit4a84ddbd30ef3cc105053f272819c2f1ea2be0d2 (patch)
treeddd893a2ce1d0d95d4d39aa5c709ef668809bd05
parent6133ea5e59cf147fc46f676fa26f415f38910de4 (diff)
downloadceph-4a84ddbd30ef3cc105053f272819c2f1ea2be0d2.tar.gz
client: Fix inode remove from snaprealm race
This is a follow on fix to b5ce4d0. Always remove the inode from the snaprealm's list of inodes_with_caps before the snaprealm ref is decremented (and the snaprealm potentially gets freed). Fixes #4694. Signed-off-by: Sam Lang <sam.lang@inktank.com> Reviewed-by: Greg Farnum <greg@inktank.com>
-rw-r--r--src/client/Client.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/Client.cc b/src/client/Client.cc
index aae22ffa980..3bc8c5bfa9a 100644
--- a/src/client/Client.cc
+++ b/src/client/Client.cc
@@ -1948,9 +1948,9 @@ void Client::send_reconnect(MetaSession *session)
in->exporting_mseq = 0;
if (!in->is_any_caps()) {
ldout(cct, 10) << " removing last cap, closing snaprealm" << dendl;
+ in->snaprealm_item.remove_myself();
put_snap_realm(in->snaprealm);
in->snaprealm = 0;
- in->snaprealm_item.remove_myself();
}
}
}
@@ -3257,8 +3257,8 @@ void Client::handle_snap(MClientSnap *m)
// queue for snap writeback
queue_cap_snap(in, in->snaprealm->get_snap_context().seq);
- put_snap_realm(in->snaprealm);
in->snaprealm_item.remove_myself();
+ put_snap_realm(in->snaprealm);
to_move.push_back(in);
}
}