Skip to content

Commit

Permalink
Merge pull request ceph#47620 from lxbsz/wip-56249
Browse files Browse the repository at this point in the history
client: stop the remount_finisher thread in the Client::unmount()

Reviewed-by: Rishabh Dave <[email protected]>
Reviewed-by: Venky Shankar <[email protected]>
Reviewed-by: Patrick Donnelly <[email protected]>
Reviewed-by: Kotresh HR <[email protected]>
Reviewed-by: Milind Changire <[email protected]>
  • Loading branch information
rishabh-d-dave authored Sep 2, 2022
2 parents bc264a9 + 90f9713 commit 831344e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/client/Client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6673,6 +6673,17 @@ void Client::_unmount(bool abort)

mref_writer.update_state(CLIENT_UNMOUNTED);

/*
* Stop the remount_queue before clearing the mountpoint memory
* to avoid possible use-after-free bug.
*/
if (remount_cb) {
ldout(cct, 10) << "unmount stopping remount finisher" << dendl;
remount_finisher.wait_for_empty();
remount_finisher.stop();
remount_cb = nullptr;
}

ldout(cct, 2) << "unmounted." << dendl;
}

Expand Down

0 comments on commit 831344e

Please sign in to comment.