]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librbd/cache/pwl: remove RBD_FEATURE_DIRTY_CACHE check in DiscardRequest 45896/head
authorIlya Dryomov <idryomov@gmail.com>
Sun, 10 Apr 2022 16:13:48 +0000 (18:13 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 13 Apr 2022 10:57:45 +0000 (12:57 +0200)
commit79386b3e48b10bfd0048af4e4e6e8e8c076b941e
tree605faed8fbb3e240003f9cffc725f5fec8ff0767
parent05c167f8cd767974d268862eb421fdf8399da391
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>
(cherry picked from commit aee78bbb9d7edd606a8a235c57b2b704d7b94e4c)
src/librbd/cache/pwl/DiscardRequest.cc