Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-11075

suspicious code in ldlm_prepare_lru_list()

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.12.0
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      There is some suspicious code in ldlm_prepare_lru_list() which should be fixed:

      static int ldlm_prepare_lru_list(struct ldlm_namespace *ns,
                                       struct list_head *cancels, int count, int max,
                                       enum ldlm_lru_flags lru_flags)
      ...
                              if (!ldlm_is_canceling(lock) || /* XXX '||' should be '&&' */
                                  !ldlm_is_converting(lock))
                                      break;
      ...
                      if (result == LDLM_POLICY_SKIP_LOCK) {
                              lu_ref_del(&lock->l_reference, __func__, current);
                              LDLM_LOCK_RELEASE(lock); /* XXX release should follow if block. */
                              if (no_wait) {
                                      spin_lock(&ns->ns_lock);
                                      if (!list_empty(&lock->l_lru) &&
                                          lock->l_lru.prev == ns->ns_last_pos)
                                              ns->ns_last_pos = &lock->l_lru;
                                      spin_unlock(&ns->ns_lock);
                              }
                              continue;
                      }
      

      Attachments

        Issue Links

          Activity

            [LU-11075] suspicious code in ldlm_prepare_lru_list()
            pjones Peter Jones added a comment -

            Landed for 2.12

            pjones Peter Jones added a comment - Landed for 2.12

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/32660/
            Subject: LU-11075 ldlm: correct logic in ldlm_prepare_lru_list()
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: aecafb57d5b60ea430ce9ef13783eb74ad4f6936

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/32660/ Subject: LU-11075 ldlm: correct logic in ldlm_prepare_lru_list() Project: fs/lustre-release Branch: master Current Patch Set: Commit: aecafb57d5b60ea430ce9ef13783eb74ad4f6936
            jhammond John Hammond added a comment -

            It's possible.

            jhammond John Hammond added a comment - It's possible.

            Could this be the root cause of LU-11092 and numerous other LDLM LRU overflow problems?

            adilger Andreas Dilger added a comment - Could this be the root cause of LU-11092 and numerous other LDLM LRU overflow problems?

            John L. Hammond (john.hammond@intel.com) uploaded a new patch: https://review.whamcloud.com/32660
            Subject: LU-11075 ldlm: correct logic in ldlm_prepare_lru_list()
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 8fe6f74a2a7fcb2b8ac1af4e00b21d04ed7f5951

            gerrit Gerrit Updater added a comment - John L. Hammond (john.hammond@intel.com) uploaded a new patch: https://review.whamcloud.com/32660 Subject: LU-11075 ldlm: correct logic in ldlm_prepare_lru_list() Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 8fe6f74a2a7fcb2b8ac1af4e00b21d04ed7f5951

            People

              jhammond John Hammond
              jhammond John Hammond
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: