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

double closedir() on error from cb_mv_init()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.6.0
    • Lustre 2.6.0
    • 3
    • 13360

    Description

      In liblustreapi.c:cb_mv_inti() if the parent cannot be opened then we will have closed *dirp but not set it to NULL. This causes a double free when closedir() is called a second time on the way out of llapi_semantic_traverse().

              if (dirp != NULL)
                      closedir(*dirp);
      
              if (parent == NULL) {
                      dir = opendir_parent(path);
                      if (dir == NULL) {
                              ret = -errno;
                              fprintf(stderr, "can not open %s ret %d\n",
      				path, ret);
                              return ret;
                      }
              }
      

      Also the fprintf() call should be llapi_error(..., "cannot open '%s'").

      Attachments

        Activity

          People

            cliffw Cliff White (Inactive)
            jhammond John Hammond
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: