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: missing brackets around if statement #37537
Conversation
bbb2513
to
002652f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the brace fix is needed, however looks like this might introduce damage at l. 459; I don't prefer pvs-studio enforced style regarding the "s" alias
src/rgw/rgw_file.cc
Outdated
@@ -1520,11 +1523,11 @@ namespace rgw { | |||
} | |||
|
|||
int RGWWriteRequest::exec_start() { | |||
struct req_state* s = get_state(); | |||
struct req_state* _s = get_state(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like naming variables _something, esp local
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. will rename to "state".
a better fix was to change "s" in the parent where its is "protected" to "private" - but this would probably cause too many code changes in other places...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, that's a good solution
src/rgw/rgw_file.h
Outdated
@@ -456,11 +456,6 @@ namespace rgw { | |||
st->st_nlink = state.nlink; | |||
break; | |||
case RGW_FS_TYPE_FILE: | |||
st->st_nlink = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how we want to do this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the original version st->st_link = 1;
was under both RGW_FS_TYPE_FILE
and RGW_FS_TYPE_SYMBOLIC_LINK
so, either we can collapse them to one case, or we need to fix this line in one of the cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, we're kind of inventing a value for reporting purposes, but I'd like them to be distinct for the different object types for clarity. I'm actually not clear how having this assignment in disjoint cases is a problem, maybe I'm missing something obvious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
originally, there were 2 different cases with exactly the same code.
so, either, we can collapse them to one case, or there was a copy&paste bug in the original code.
but if you think it is ok to duplicate the code in the 2 cases, i can revert the change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, there is no problem having 2 cases that take the same action, in this case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. will revert
002652f
to
48104cd
Compare
jenkins test signed |
jenkins test make check |
<< " prefix=" << prefix << " " | ||
<< " pref path=" << name << " (not chomped)" | ||
<< " target = " << path << "" | ||
<< dendl; | ||
matched = true; | ||
/* match-dir case (trailing '/') */ | ||
if (name == prefix + "/") | ||
if (name == prefix + "/") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mattbenjamin seems like this fix have broken the folllowing s3 test:
020-10-05T12:18:54.519 INFO:teuthology.orchestra.run.smithi119.stderr:======================================================================
2020-10-05T12:18:54.519 INFO:teuthology.orchestra.run.smithi119.stderr:FAIL: s3tests_boto3.functional.test_s3.test_bucket_listv2_delimiter_basic
2020-10-05T12:18:54.519 INFO:teuthology.orchestra.run.smithi119.stderr:----------------------------------------------------------------------
2020-10-05T12:18:54.520 INFO:teuthology.orchestra.run.smithi119.stderr:Traceback (most recent call last):
2020-10-05T12:18:54.520 INFO:teuthology.orchestra.run.smithi119.stderr: File "/home/ubuntu/cephtest/s3-tests/virtualenv/lib/python3.6/site-packages/nose/case.py", line 198, in runTest
2020-10-05T12:18:54.520 INFO:teuthology.orchestra.run.smithi119.stderr: self.test(*self.arg)
2020-10-05T12:18:54.520 INFO:teuthology.orchestra.run.smithi119.stderr: File "/home/ubuntu/cephtest/s3-tests/s3tests_boto3/functional/test_s3.py", line 232, in test_bucket_listv2_delimiter_basic
2020-10-05T12:18:54.520 INFO:teuthology.orchestra.run.smithi119.stderr: eq(response['KeyCount'], len(prefixes) + len(keys))
2020-10-05T12:18:54.520 INFO:teuthology.orchestra.run.smithi119.stderr:AssertionError: 1 != 3
either the fix is incorrect or the test has a bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change in rgw_file.{h,cc} couldn't change the expected results of that s3-test, I don't think, I can't explain that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right. it is failing on master as well (when I run s3test locally).
the title of the commit message reads like a bug report. ideally, the title of the commit message should use the imperative mood. see also https://github.com/ceph/ceph/blob/master/SubmittingPatches.rst#3-describe-your-changes . please use |
recent teuthology results see here: #37534 (comment) |
also some small style issues issues were detected by pvs-studio static analyzer Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
48104cd
to
fb7c5b4
Compare
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
jenkins test make check |
also some small style issues
issues were detected by pvs-studio static analyzer
Signed-off-by: Yuval Lifshitz ylifshit@redhat.com
Show available Jenkins commands
jenkins retest this please
jenkins test classic perf
jenkins test crimson perf
jenkins test signed
jenkins test make check
jenkins test make check arm64
jenkins test submodules
jenkins test dashboard
jenkins test api
jenkins test docs
jenkins render docs
jenkins test ceph-volume all
jenkins test ceph-volume tox