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: avoid evaluating nullptr for readdir offset #20145

Merged
merged 1 commit into from Feb 5, 2018

Conversation

mattbenjamin
Copy link
Contributor

I've found by experimentation that passing a null pointer
as a value to a CachedPrebufferedStreambuf ostream caused
subsequent log prints to be squelched.

(That's likely a bug, doesn't happen when the thread_local
optimization change is reverted.)

Fixes: https://tracker.ceph.com/issues/22820

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

I've found by experimentation that passing a null pointer
as a value to a CachedPrebufferedStreambuf ostream caused
subsequent log prints to be squelched.

(That's likely a bug, doesn't happen when the thread_local
optimization change is reverted.)

Fixes: https://tracker.ceph.com/issues/22820

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
@mattbenjamin
Copy link
Contributor Author

@aclamk when you have time, can you think how this type of behavior might occur, and how to make the cached ostreams recover from it?

@cbodley
Copy link
Contributor

cbodley commented Jan 29, 2018

@mattbenjamin @aclamk writing nullptr to a stream will set its badbit, which would persist between log entries when using the thread_local ostream. so in the thread_local case, i think we need to add a call to clear() these flags

@cbodley
Copy link
Contributor

cbodley commented Jan 29, 2018

@mattbenjamin @aclamk see #20174

@mattbenjamin
Copy link
Contributor Author

@cbodley did you see a technical problem with this change? It doesn't purport to fix the stream problem in general, but does fix an output bug

@mattbenjamin mattbenjamin merged commit 80a58a4 into ceph:master Feb 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants