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: fix double unref on rgw_fh for rename #13988

Merged
merged 1 commit into from Mar 20, 2017

Conversation

guihecheng
Copy link

@guihecheng guihecheng commented Mar 16, 2017

Skip unref after unlink to fix the problem.

Signed-off-by: Gui Hecheng guihecheng@cmss.chinamobile.com

@mattbenjamin
Copy link
Contributor

@guihecheng I think you're right about the double unref (not double free, since we are refcounting), but I think my intent (see comment in case 1 /*!LOCKED, -ref */) in the code was that the unlink would be the last valid access to rgw_fh, so rather than omitting to unlock and unref in unlink, we should goto out or return here in rename, because we are not supposed to touch rgw_fh after unlinking it. Can you buy that?

@mattbenjamin mattbenjamin self-assigned this Mar 16, 2017
@guihecheng
Copy link
Author

@mattbenjamin ok, it is reasonable that unlink should always be the one to kill an fh, thanks.

Skip unref after unlink to fix the problem.

Signed-off-by: Gui Hecheng <guihecheng@cmss.chinamobile.com>
@guihecheng guihecheng changed the title rgw_file: fix double free on rgw_fh for rename rgw_file: fix double unref on rgw_fh for rename Mar 17, 2017
@dmick
Copy link
Member

dmick commented Mar 17, 2017

My fault the submodule test failed, ignore

@mattbenjamin mattbenjamin self-requested a review March 19, 2017 15:42
Copy link
Contributor

@mattbenjamin mattbenjamin left a comment

Choose a reason for hiding this comment

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

looks good logically, will retest before merging

@mattbenjamin
Copy link
Contributor

@guihecheng this appears to work perfectly, combined w/Dan's version of the nfs-ganesha invalidate-for-rename change (sorry again that was lost, and thanks for root-causing and proposing a fix!)

@mattbenjamin
Copy link
Contributor

verified f23

@mattbenjamin mattbenjamin merged commit 2beb4ee into ceph:master Mar 20, 2017
@guihecheng guihecheng deleted the rgw_file-fix-rename branch April 7, 2017 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants