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

mdc: mdc_create() leaks the request on a bad mkdir reply

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • None
    • 3
    • 9223372036854775807

      In mdc_create(), after a successful reint for a directory, two error exits return before *request = req:
       
        - req_capsule_server_get(&RMF_MDT_BODY) returns NULL → RETURN(-EPROTO)
        - req_capsule_server_sized_get(&RMF_MDT_MD) returns NULL → RETURN(-EPROTO)
       
      The caller never gets the request, so it is never put. The request leaks, and with it the import reference taken by ptlrpc_request_alloc(). A short or malformed mkdir reply from the MDT can trigger either one.
       
      Fix: ptlrpc_req_put(req) before both returns, or set *request = req first so the caller drops it.
        
      Found during review of https://review.whamcloud.com/65026 (LU-20050)

            hnishida Hiroshi Nishida
            hnishida Hiroshi Nishida
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: