]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd/cache/pwl: remove RBD_FEATURE_DIRTY_CACHE check in DiscardRequest 44236/head
authorIlya Dryomov <idryomov@gmail.com>
Sun, 10 Apr 2022 16:13:48 +0000 (18:13 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 12 Apr 2022 16:42:06 +0000 (18:42 +0200)
commitaee78bbb9d7edd606a8a235c57b2b704d7b94e4c
tree43b80103032d9b187959846b1f5e1bee27147109
parent63197ff7003fa9e595527a7431f9f3f6790f7d57
librbd/cache/pwl: remove RBD_FEATURE_DIRTY_CACHE check in DiscardRequest

"m_image_ctx.features &&RBD_FEATURE_DIRTY_CACHE" is obviously wrong
because it would pretty much always be true.  However, even if bitwise
AND was used, this check would still be dead because DiscardRequest is
only invoked if RBD_FEATURE_DIRTY_CACHE is enabled:

  int invalidate_cache(ImageCtx *ictx) {
  {
    ...
    // Delete writeback cache if it is not initialized
    if ((!ictx->exclusive_lock ||
         !ictx->exclusive_lock->is_lock_owner()) &&
ictx->test_features(RBD_FEATURE_DIRTY_CACHE)) {
      C_SaferCond ctx3;
      ictx->plugin_registry->discard(&ctx3);
      r = ctx3.wait();
    }

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
src/librbd/cache/pwl/DiscardRequest.cc