]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
test/bufferlist: ensure rebuild_aligned_size_and_memory() always rebuilds. 46216/head
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Fri, 21 Jan 2022 01:50:22 +0000 (01:50 +0000)
committerRadosław Zarzyński <rzarzyns@redhat.com>
Tue, 10 May 2022 12:33:26 +0000 (14:33 +0200)
commit49872ccf083947a8cf46f7a84591d1ee67e2c767
tree5429987b5a18171601207c2c95b9b5001c526d43
parentf03fee0abad67d83cd94526b4a670870b2ddba1e
test/bufferlist: ensure rebuild_aligned_size_and_memory() always rebuilds.

Before the patch the test case was showing an unreliable behaviour
dependent on the underlying memory allocator. It was because
the bufferlist rebuild can be skipped, resulting in unchanged number
of buffers, if all of them begin at aligned addresses.

The commit fixes that by allocating a 4 KiB-aligned buffer and
offsetting it by a small constant (42) to ensure the memory added
to the bufferlist begins at non-4 KiB address.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
(cherry picked from commit 88176acd27b0d495abf9396c7ae2c6ec3fa46b1b)
src/test/bufferlist.cc