]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
os/: modify getattrs to clear attrs out param before populating 57006/head
authorSamuel Just <sjust@redhat.com>
Thu, 18 Apr 2024 22:19:31 +0000 (15:19 -0700)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Thu, 2 May 2024 19:00:09 +0000 (19:00 +0000)
commit7ae46186760746f239d88ed804e08732f645373f
tree49d44452f3b604dfb5c619724ad455969f368eef
parentf087679af5af13de4e282f3f01eae6dab6684ad4
os/: modify getattrs to clear attrs out param before populating

Passing in a non-empty map would otherwise exhibit quite unexpected
behavior.  For the bufferptr overload, any preexisting entries would
not be overwritten due to how std::map::emplace behaves.  For the
bufferlist overload, it would result in appending to any pre-existing
entries.

The prior commit cleans up one such inadvertent caller which resulted
in the below bug.

Fixes: https://tracker.ceph.com/issues/65185
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit 915f92ba9dc8e192bdcebcb92e7d06a93a401f5d)
src/os/ObjectStore.h
src/os/bluestore/BlueStore.cc