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

uninitialized variable use in (zfs) osd_create_last_id()

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • Lustre 2.17.0
    • Lustre 2.17.0
    • 3
    • 9223372036854775807

    Description

      smatch highlights that hdl is potentially unused in osd_create_last_id():

      static int osd_create_lastid(const struct lu_env *env, struct osd_device *dev,
                                   struct osd_zap_it *ozi, __u64 lastid_known)
      {
      ...
              sa_handle_t *hdl;
      ...
      
              ENTRY;
              tx = dmu_tx_create(dev->od_os);
              if (!tx)
                      GOTO(out, rc = -ENOMEM);
              dmu_tx_hold_sa_create(tx, osd_find_dnsize(dev, OSD_BASE_EA_IN_BONUS));
              dmu_tx_hold_zap(tx, dir, FALSE, NULL);
              rc = -dmu_tx_assign(tx, DMU_TX_WAIT);
              if (rc)
                      GOTO(abort, rc);
      ... a lot more of these error exits ...
      abort:
              if (dn)
                      dmu_object_free(dev->od_os, dn->dn_object, tx);
              dmu_tx_abort(tx);
      out:
              if (hdl) <<<===== uninitialized variable use.
                      sa_handle_destroy(hdl);
      

      Introduced by https://review.whamcloud.com/c/fs/lustre-release/+/53898

      Surprised gcc did not flag it.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated: