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

bad error return from ofd_precreate_objects()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Minor
    • None
    • Lustre 2.5.0
    • 3
    • 10902

    Description

      An error path in ofd_precreate_objects() applies PTR_ERR() to a NULL pointer.

              struct ofd_object       *fo = NULL;
              ...
              /* prepare objects */
              ostid_set_seq(&info->fti_ostid, ostid_seq(&oseq->os_oi));
              for (i = 0; i < nr; i++) {
                      ostid_set_id(&info->fti_ostid, id + i);
                      rc = ostid_to_fid(&info->fti_fid, &info->fti_ostid, 0);
                      if (rc) {
                              if (i == 0)
                                      GOTO(out, rc = PTR_ERR(fo));
      
                              nr = i;
                              break;
                      }
      
                      fo = ofd_object_find(env, ofd, &info->fti_fid);
                      if (IS_ERR(fo)) {
                              if (i == 0)
                                      GOTO(out, rc = PTR_ERR(fo));
      
                              nr = i;
                              break;
                      }
      

      The first GOTO statement should be GOTO(out, rc). This was found using a script from the coccinelle examples directory.

      Attachments

        Activity

          People

            wc-triage WC Triage
            jhammond John Hammond
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: