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: cleanup rgw-admin duplicated judge during OLH GET/READLOG #15700

Merged
merged 2 commits into from Jul 6, 2017

Conversation

Projects
None yet
4 participants
@mikulely
Contributor

mikulely commented Jun 15, 2017

No description provided.

if (ret < 0) {
cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl;
return -ret;
}

This comment has been minimized.

@cbodley

cbodley Jun 16, 2017

Contributor

i see that these calls to init_bucket() are duplicated above in the if (opt_cmd == OPT_OLH_GET || opt_cmd == OPT_OLH_READLOG) { block

but that block initializes a locally-scoped RGWBucketInfo bucket_info;, rather than the one in main()'s scope. so the call to store->get_olh() here would be using an uninitialized bucket_info

so it looks like you also need to remove that extra RGWBucketInfo bucket_info; in the block above

This comment has been minimized.

@mikulely

mikulely Jun 19, 2017

Contributor

After recheck I've found the global RGWBucketInfo bucket_info didn't has been initialized and used.

Each if (cmd == XXX ) {} block that initialize the local var
RGWBucketInfo bucket_info explicitly by invoking init_bucket(). Maybe we need to stick to this pattern for consistency.

repushed. Plz review again.

mikulely added some commits Jun 18, 2017

rgw: cleanup rgw-admin duplicated judge during OLH GET/READLOG
Signed-off-by: Jiaying Ren <jiaying.ren@umcloud.com>
rgw: drop deprecated global var
Each if (cmd == XXX ) {} block that initialize the local var
`RGWBucketInfo bucket_info` explicitly by invoking `init_bucket()`.

Signed-off-by: Jiaying Ren <jiaying.ren@umcloud.com>

@cbodley cbodley added the needs-qa label Jun 23, 2017

@yuriw yuriw merged commit 4ba3e87 into ceph:master Jul 6, 2017

4 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
arm64 make check arm64 make check succeeded
Details
make check make check succeeded
Details
@mikulely

This comment has been minimized.

Contributor

mikulely commented Jul 7, 2017

Thanks @cbodley @yuriw for merging this!

@mikulely mikulely deleted the mikulely:olh-cleanup branch Jul 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment