Skip to content

client: anchor dentries for trimming to make cap traversal safe#22073

Merged
batrick merged 2 commits intoceph:masterfrom
batrick:i24137
May 19, 2018
Merged

client: anchor dentries for trimming to make cap traversal safe#22073
batrick merged 2 commits intoceph:masterfrom
batrick:i24137

Conversation

@batrick
Copy link
Member

@batrick batrick commented May 18, 2018

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

Signed-off-by: Patrick Donnelly pdonnell@redhat.com

@batrick batrick added bug-fix cephfs Ceph File System labels May 18, 2018
@batrick batrick requested a review from ukernel May 18, 2018 00:13
@batrick
Copy link
Member Author

batrick commented May 18, 2018

@ukernel thanks for the reproducer. I'm working on adding it to a QA test.

I think this fix is simpler than what you had posted in [1]; I don't like the absurd complexity of deleting dentries during traversal, so let's not do it.

[1] http://tracker.ceph.com/issues/24137

}
}
ldout(cct, 20) << " clearing anchored inodes" << dendl;
ldout(cct, 20) << " clearing anchored dentries" << dendl;
Copy link
Contributor

Choose a reason for hiding this comment

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

"trimming anchored dentries"

Copy link
Member Author

Choose a reason for hiding this comment

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

done, thanks

uint64_t trimmed = 0;
auto p = s->caps.begin();
std::set<InodeRef> anchor; /* prevent put_inode from deleting all caps during traversal */
std::set<Dentry *> anchor; /* prevent put_inode from deleting all caps during traversal */
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe rename 'anchor' to 'to_trim'

Copy link
Member Author

Choose a reason for hiding this comment

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

done, thanks

@batrick
Copy link
Member Author

batrick commented May 19, 2018

@ukernel
Copy link
Contributor

ukernel commented May 19, 2018

I think it's better to not add the qa test. It's too tricky to arrange inodes in session->caps. we don't know if it still works in the future.

@batrick
Copy link
Member Author

batrick commented May 19, 2018

It doesn't hurt to run the test so I'm inclined to keep it for now. It serves as a useful template for other tests. I'll add a note that it's unlikely to continue testing as expected.

batrick added 2 commits May 18, 2018 21:35
Test case by Yan Zheng [1].

[1] http://tracker.ceph.com/issues/24137#note-6

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Fixes: http://tracker.ceph.com/issues/24137

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
@batrick batrick merged commit 9199179 into ceph:master May 19, 2018
batrick added a commit that referenced this pull request May 19, 2018
* refs/pull/22073/head:
	client: delay dentry trimming until after cap traversal
	qa: test for trim_caps segfault for trimmed dentries

Reviewed-by: Zheng Yan <zyan@redhat.com>
@batrick batrick deleted the i24137 branch May 19, 2018 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix cephfs Ceph File System

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants