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

strange redundant rc checks in ldlm

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      smatch highlights these two redundant checks in ldlm.

      ldlm_lock.c::ldlm_lock_enqueue:

                      } else if (rc != ELDLM_OK ||
                                 (rc == ELDLM_OK && (*flags & LDLM_FL_INTENT_ONLY))) {
                              ldlm_lock_destroy(lock);
                              return rc;
                      }
      

      We probbly can just drop the other 'rc ==' check

      ldlm_lib.c::client_connect_import():

              rc = ptlrpc_connect_import(imp);
              if (rc != 0) {
                      LASSERT(imp->imp_state == LUSTRE_IMP_DISCON);
                      goto out_ldlm;
              }
      ...
              if (rc) {
      out_ldlm:
                      cli->cl_conn_count--;
                      class_disconnect(*exp);
      

      We probably can drop the latter rc check now?

      Attachments

        Activity

          People

            wc-triage WC Triage
            green Oleg Drokin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: