osd: call deref_object_state on recheck_state mismatch in remove_object_from_state #91

Merged
vitalif merged 1 commits from changwei.ye/vitastor:fix-remove-object-from-state into master 2026-10-17 21:21:35 +03:00

1 Commits

Author SHA1 Message Date
Changwei Ye
6509cb85b3 osd: call deref_object_state on recheck_state mismatch in remove_object_from_state
When recheck_state != *object_state, the old object_state reference should be
released via deref_object_state() instead of raw ref_count--. Otherwise, if the
old state has no remaining objects (object_count == 0) and this was its last
reference, it would never be erased from pg.state_dict, leaking memory and state
dictionary entries.
2026-10-15 10:07:18 +08:00