]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librbd/cache/pwl:fix clean vs bytes_dirty cache state inconsistency 48542/head
authorYin Congmin <congmin.yin@intel.com>
Wed, 19 Oct 2022 02:47:35 +0000 (10:47 +0800)
committerYin Congmin <congmin.yin@intel.com>
Mon, 24 Oct 2022 05:42:01 +0000 (13:42 +0800)
commite2b079137473d4c819d58ef6466450a5c4a8b8af
tree8b71ea318ee4c94d1b74c6209d3468d98b38a074
parent30874f8cc360c35d8b7b73945e277bfb85074bde
librbd/cache/pwl:fix clean vs bytes_dirty cache state inconsistency

The space of the pwl is pre allocated. In check_allocation(), the space
is reserved, and then the op is completed after a period of process.
When checking resource is successful and the resource is reserved,
dirty_bytes has been increased. But new entry will not be added
to m_dirty_log_entries until the op is finished. This time gap
leads to inconsistencies.

Put update_image_cache_state() in check_allocation() to fix this
issue. It is now considered that as long as space is reserved
and the op is started, the cache is dirty.

Fixes: https://tracker.ceph.com/issues/57872
Signed-off-by: Yin Congmin <congmin.yin@intel.com>
src/librbd/cache/pwl/AbstractWriteLog.cc