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>
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();
}
}
}
// 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);
}
}