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

osp_update_request_create() should check return value

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.9.0
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      struct osp_update_request *osp_update_request_create(struct dt_device *dt)
      {
              struct osp_update_request *our;
      
              OBD_ALLOC_PTR(our);
              if (our == NULL)
                      return ERR_PTR(-ENOMEM);
      
              INIT_LIST_HEAD(&our->our_req_list);
              INIT_LIST_HEAD(&our->our_cb_items);
              INIT_LIST_HEAD(&our->our_list);
      
              osp_object_update_request_create(our, OUT_UPDATE_INIT_BUFFER_SIZE);
              return our;
      }
      

      osp_update_request_create() doesn't check the return value of osp_object_update_request_create(), so it could return a 'our' without 'ours_request' attached if memory allocation failed in osp_object_update_request_create().

      But all the callers of osp_update_request_create() assumes the 'our' must have 'ours_request' attached. See osp_insert_async_request() or osp_update_rpc_pack().

      Attachments

        Issue Links

          Activity

            People

              niu Niu Yawei (Inactive)
              niu Niu Yawei (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: