]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
os/: modify getattrs to clear attrs out param before populating
authorSamuel Just <sjust@redhat.com>
Thu, 18 Apr 2024 22:19:31 +0000 (15:19 -0700)
committerSamuel Just <sjust@redhat.com>
Fri, 19 Apr 2024 02:49:39 +0000 (02:49 +0000)
commit915f92ba9dc8e192bdcebcb92e7d06a93a401f5d
treedcf74c4ab16d53b51c25a8d2e2d250af4d1ad412
parent5671e8555eddc622a6edb926e67dadce79e6add5
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>
src/os/ObjectStore.h
src/os/bluestore/BlueStore.cc