rocksdb/env
Sagar Vemuri 68614a9608 Fix AlignedBuffer's usage in Encryption Env (#5396)
Summary:
The usage of `AlignedBuffer` in env_encryption.cc writes and reads to/from the AlignedBuffer's internal buffer directly without going through AlignedBuffer's APIs (like `Append` and `Read`), causing encapsulation to break in some cases. The writes are especially problematic as after the data is written to the buffer (directly using either memmove or memcpy), the size of the buffer is not updated ... causing the AlignedBuffer to lose track of the encapsulated buffer's current size.
Fixed this by updating the buffer size after every write.

Todo for later:
Add an overloaded method to AlignedBuffer to support a memmove in addition to a memcopy. Encryption env does a memmove, and hence I couldn't switch to using `AlignedBuffer.Append()`.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5396

Test Plan: `make check`

Differential Revision: D15764756

Pulled By: sagar0

fbshipit-source-id: 2e24b52bd3b4b5056c5c1da157f91ddf89370183
2019-06-19 16:46:20 -07:00
..
env_basic_test.cc Move test related files under util/ to test_util/ (#5377) 2019-05-30 11:25:51 -07:00
env_chroot.cc Apply modernize-use-override (3) 2019-02-19 13:39:49 -08:00
env_chroot.h Change RocksDB License 2017-07-15 16:11:23 -07:00
env_encryption.cc Fix AlignedBuffer's usage in Encryption Env (#5396) 2019-06-19 16:46:20 -07:00
env_hdfs.cc Fix compilation with USE_HDFS (#5444) 2019-06-18 14:55:59 -07:00
env_posix.cc Fix tsan error (#5414) 2019-06-05 15:42:23 -07:00
env_test.cc Fix build errors regarding const qualifier being ignored on cast result type (#5432) 2019-06-07 19:37:41 -07:00
env.cc Move some memory related files from util/ to memory/ (#5382) 2019-05-30 17:44:09 -07:00
io_posix.cc Dynamic test whether sync_file_range returns ENOSYS (#5416) 2019-06-13 13:56:10 -07:00
io_posix.h Optionally wait on bytes_per_sync to smooth I/O (#5183) 2019-04-22 11:51:39 -07:00
mock_env_test.cc Move test related files under util/ to test_util/ (#5377) 2019-05-30 11:25:51 -07:00
mock_env.cc Apply modernize-use-override (3) 2019-02-19 13:39:49 -08:00
mock_env.h Update all unique/shared_ptr instances to be qualified with namespace std (#4638) 2018-11-09 11:19:58 -08:00