Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgw_file: avoid a recursive lane lock in LRU drain #15819

Merged
merged 1 commit into from
Jun 22, 2017

Conversation

mattbenjamin
Copy link
Contributor

While highly unlikely in normal fs operations, draining an
entire filesystem could induce a recursion on object delete/unref,
when provoked by cohort_lru::drain().

Found running librgw_file_nfsns unit test.

Fixes: http://tracker.ceph.com/issues/20374

Signed-off-by: Matt Benjamin mbenjamin@redhat.com

@guihecheng
Copy link

@mattbenjamin oh, I've encountered this before, I shall try it out soon, thanks~

@mattbenjamin
Copy link
Contributor Author

retest this please

@mattbenjamin
Copy link
Contributor Author

retest this please

* safe_link mode */
uref(v);
p.tr.erase(it);
drain_q.push_front(*v); /* safe to re-use hook, !LINKED */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

regarding the comment: this is using the new q2_hook, not reusing lru_hook

While highly unlikely in normal fs operations, draining an
entire filesystem could induce a recursion on object delete/unref,
when provoked by cohort_lru::drain().

Adjusted to use intrusive slist rather than std:vector<T*>
after review.

Found running librgw_file_nfsns unit test.

Fixes: http://tracker.ceph.com/issues/20374

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
@mattbenjamin mattbenjamin merged commit 34ab09b into ceph:master Jun 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants