diff options
author | Jeff Layton <jlayton@kernel.org> | 2021-07-27 15:47:12 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2021-09-02 22:49:17 +0200 |
commit | b4002173b7989588b6feaefc42edaf011b596782 (patch) | |
tree | e078e38dc658473974fb44b862d2c284fd6b45ae /Documentation/sparc | |
parent | 40e309de4dd84ba91b9e0549a5173ce13ef02c5e (diff) | |
download | linux-b4002173b7989588b6feaefc42edaf011b596782.tar.bz2 |
ceph: cancel delayed work instead of flushing on mdsc teardown
The first thing metric_delayed_work does is check mdsc->stopping,
and then return immediately if it's set. That's good since we would
have already torn down the metric structures at this point, otherwise,
but there is no locking around mdsc->stopping.
It's possible that the ceph_metric_destroy call could race with the
delayed_work, in which case we could end up with the delayed_work
accessing destroyed percpu variables.
At this point in the mdsc teardown, the "stopping" flag has already been
set, so there's no benefit to flushing the work. Move the work
cancellation in ceph_metric_destroy ahead of the percpu variable
destruction, and eliminate the flush_delayed_work call in
ceph_mdsc_destroy.
Fixes: 18f473b384a6 ("ceph: periodically send perf metrics to MDSes")
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'Documentation/sparc')
0 files changed, 0 insertions, 0 deletions