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

mds: fix stray creation/removal notification #14554

Merged
merged 1 commit into from Apr 19, 2017

Conversation

Projects
None yet
2 participants
@ukernel
Copy link
Member

ukernel commented Apr 14, 2017

In MDCache::scan_stray_dir(), notify_stray_created() is called for
both null and non-null dentries. This is wrong, it should be called
only for non-null dentries.

Calling notify_stray_created() in MDCache::get_or_create_stray_dentry()
is racy too. MDS can create wrong stray dentry because the linkage of
target dentry can change before rename/rmdir has acquired the dentry lock.

Fixes: http://tracker.ceph.com/issues/19630
Signed-off-by: "Yan, Zheng" zyan@redhat.com

@jcsp

jcsp approved these changes Apr 15, 2017

Copy link
Contributor

jcsp left a comment

This certainly looks more robust

@jcsp

This comment has been minimized.

Copy link
Contributor

jcsp commented Apr 15, 2017

I'm seeing a failure on the stray count statistics which is probably related to this change here:
http://qa-proxy.ceph.com/teuthology/jspray-2017-04-15_15:43:43-fs-wip-jcsp-testing-20170415-distro-basic-smithi/1029971/teuthology.log

mds: fix stray creation/removal notification
In MDCache::scan_stray_dir(), notify_stray_created() is called for
both null and non-null dentries. This is wrong, it should be called
only for non-null dentries.

Calling notify_stray_created() in MDCache::get_or_create_stray_dentry()
is racy too. MDS can create wrong stray dentry because target dentry
linkage can change before rmdir/rename lock the dentry lock.

Fixes: http://tracker.ceph.com/issues/19630
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>

@ukernel ukernel force-pushed the ukernel:wip-19630 branch from 314e510 to dbe7382 Apr 17, 2017

@ukernel

This comment has been minimized.

Copy link
Member Author

ukernel commented Apr 17, 2017

Fixed. The test case expects num_strays get updated when projecting change to stray dentry's linkage

@jcsp

jcsp approved these changes Apr 18, 2017

@jcsp jcsp merged commit b4bd579 into ceph:master Apr 19, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details

@ukernel ukernel deleted the ukernel:wip-19630 branch May 11, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.