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

Potential NULL pointer dereference in top_trans_stop

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not a Bug
    • Minor
    • None
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      top_trans_stop has this code:

                      rc = dt_trans_stop(env, master_st->st_dt, master_st->st_sub_th);
                      if (rc < 0) {
                              th->th_result = rc;
                              GOTO(stop_other_trans, rc);
                      } else if (tur != NULL && tur->tur_update_records != NULL) {
                              struct llog_update_record *lur;
      
                              lur = tur->tur_update_records;
      ....
              if (write_updates) {
                      struct llog_update_record *lur;
      
                      /* Stop callback of master will add more updates and also update
                       * master transno, so merge the parameters and updates into one
                       * buffer again */
                      rc = prepare_writing_updates(env, tmt);
                      if (rc < 0) {
                              CERROR("%s: prepare updates failed: rc = %d\n",
                                     master_dev->dd_lu_dev.ld_obd->obd_name, rc);
                              th->th_result = rc;
                              GOTO(stop_other_trans, rc);
                      }
                      lur = tur->tur_update_records;
      

      So in a very similar bits one makes sure tur is not NULL and the other takes it for granted which is a bit strange and probably hides a bug.

      Attachments

        Activity

          People

            di.wang Di Wang
            green Oleg Drokin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: