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
os/filestore: require offset == length == 0 for full object read; add test #7957
Conversation
@@ -2522,7 +2522,7 @@ int BlueStore::read( | |||
goto out; | |||
} | |||
|
|||
if (offset == length && offset == 0) | |||
if (lenght == 0) |
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.
s/lenght/length/
832d1a9
to
671dc14
Compare
I don't think this is right.. if I do offset 2000 and length 0 i do'nt want to read the object size from offset 2000. I think only offset == length == 0 makes sense. BTW, is there store_test.cc test that covers this case? |
@liewegas .
In FileStore::read
I don't find test case in store_test.cc. |
I guess the good news is the do_osd_ops code already populates the length,
so we don't need to worry about it (although I wish it also checked that
offset == 0).
Can you add a store_test.cc test case that passes offset == len == 0?
Let's enshrine that as the correct behavior for ObjectStore, at
least.
And in another patch let's add an offset == 0 check for FileStore. The
only callers that pass len 0 won't be coming from do_osd_ops so I think
we're safe there.
|
671dc14
to
80f3bc7
Compare
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
Probably I missed something but I don't see any changes at bluestore.cc at the moment. Only Filestore.cc is updated. Is this correct? |
Answering myself - that's correct. Just PR name is confusing... |
os/filestore: require offset == length == 0 for full object read; add test Reviewed-by: Sage Weil <sage@redhat.com> Reviewed-by: Igor Fedotov <ifedotov@mirantis.com>
Like FileStore, length=0 mean length=object.size.
Signed-off-by: Jianpeng Ma jianpeng.ma@intel.com