Skip to content

Commit

Permalink
Merge pull request #12859 from ukernel/wip-18460
Browse files Browse the repository at this point in the history
client: fix Client::handle_cap_flushsnap_ack() crash

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
  • Loading branch information
John Spray committed Jan 13, 2017
2 parents 72103cf + 525c52f commit 868d419
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/client/Client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4796,6 +4796,9 @@ void Client::handle_cap_flushsnap_ack(MetaSession *session, Inode *in, MClientCa
} else {
ldout(cct, 5) << "handle_cap_flushedsnap mds." << mds << " flushed snap follows " << follows
<< " on " << *in << dendl;
InodeRef tmp_ref;
if (in->get_num_ref() == 1)
tmp_ref = in; // make sure inode not get freed while erasing item from in->cap_snaps
if (in->flushing_caps == 0 && in->cap_snaps.empty())
in->flushing_cap_item.remove_myself();
session->flushing_caps_tids.erase(capsnap.flush_tid);
Expand Down

0 comments on commit 868d419

Please sign in to comment.