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

Wrong order of locking and allocating memory in mgs_pool_cmd()

    XMLWordPrintable

Details

    • 3
    • 9280

    Description

      In function mgs_pool_cmd(), fsdb_mutex is locked and then mti is allocated. It is not correct and will cause problem if memory allocating fails and leaves fsdb_mutex locked. Following is the codes.

      mutex_lock(&fsdb->fsdb_mutex);

      if (canceled_label != NULL)

      { OBD_ALLOC_PTR(mti); if (mti == NULL) GOTO(out_cancel, rc = -ENOMEM); }

      Attachments

        Activity

          People

            keith Keith Mannthey (Inactive)
            lixi Li Xi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: