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

OBD_ALLOC_POST() body should be enclosed in a do ... while (0)

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
    • Severity:
      3
    • Rank (Obsolete):
      9223372036854775807

      Description

      The definition of OBD_ALLOC_POST() needs ot be corrected so that it can be used as it it used:

      #define OBD_ALLOC_POST(ptr, size, name)                                 \
                      obd_memory_add(size);                                   \
                      CDEBUG(D_MALLOC, name " '" #ptr "': %d at %p.\n",       \
                             (int)(size), ptr)
      
      ...
      
      #define __OBD_MALLOC_VERBOSE(ptr, cptab, cpt, size, flags)                    \
      do {                                                                          \
              (ptr) = (cptab) == NULL ?                                             \
                      kmalloc(size, (flags) | __GFP_ZERO) :                         \
                      cfs_cpt_malloc(cptab, cpt, size, (flags) | __GFP_ZERO);       \
              if (likely((ptr) != NULL))                                            \
                      OBD_ALLOC_POST(ptr, size, "kmalloced");                       \
      } while (0)
      

        Attachments

          Activity

            People

            • Assignee:
              wc-triage WC Triage
              Reporter:
              jhammond John Hammond
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: