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: release rgw_fh lock and ref on ENOTEMPTY #15246

Merged
merged 1 commit into from May 23, 2017

Conversation

Projects
None yet
2 participants
@mattbenjamin
Contributor

mattbenjamin commented May 23, 2017

An early return in new unlink bucket num_entries check was
missing a conditional unlock and unref.

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

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

@mattbenjamin mattbenjamin self-assigned this May 23, 2017

@mattbenjamin mattbenjamin requested a review from cbodley May 23, 2017

bkt_fh = get<0>(fhr);
if (unlikely(! bkt_fh)) {
/* implies !rgw_fh, so also !LOCKED */
return -ENOENT;
}
if (bs.num_entries > 1) {
unref(bkt_fh); /* return extra ref */
unref(bkt_fh); /* return stat_bucket ref */
if (likely(!! rgw_fh)) { /* return lock and ref from lookup_fh */

This comment has been minimized.

@cbodley

cbodley May 23, 2017

Contributor

is it not possible to get here in the FLAG_UNLINK_THIS case, which doesn't call lookup_fh()?

This comment has been minimized.

@mattbenjamin

mattbenjamin May 23, 2017

Contributor

yes. ok, per convo, updating comment to clarify that in the FLAG_UNLINK_THIS case, we hold a lock and ref on rgw_fh, and are expected to unlock and unref

rgw_file: release rgw_fh lock and ref on ENOTEMPTY
An early return in new unlink bucket num_entries check was
missing a conditional unlock and unref.

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

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

@mattbenjamin mattbenjamin merged commit 9f8f0d7 into ceph:master May 23, 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment