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

ptlrpc: ptlrpc_request_free() before pack leaks the import reference

XMLWordPrintable

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

      ptlrpc_request_alloc() takes an import reference (class_import_get()) and increments
      imp_reqs. ptlrpc_request_free() drops neither. If a caller frees the request before
      ptlrpc_request_pack(), both leak. The import is then never destroyed and never goes idle.

      LU-20050 and LU-20546 fixed the sepol and pack-failure cases. Some pre-pack exits in
      osc_brw_prep_request() still leak:

        - the encryption folio array allocation, obd_pool_get_folios_array(), and the per-page
          encryption failure
        - cl_env_get() failure
        - cl_object_attr_get() failure
        - the -ENODATA exit for an empty RPC to an old server

      Possible fix: when rq_import is still set, let ptlrpc_request_free() itself decrement
      imp_reqs and call class_import_put(). After LU-20546, a pack failure clears rq_import, so
      callers that free after a failed pack stay correct. This needs an audit of all
      ptlrpc_request_free() callers. It would also remove the open-coded put in
      ptlrpc_request_alloc_internal().
        
      Found during review of https://review.whamcloud.com/68582 (LU-20546)

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

              Created:
              Updated: