[LU-6888] osp_update_request_create() should check return value Created: 21/Jul/15  Updated: 06/Dec/16  Resolved: 27/Jul/16

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.9.0

Type: Bug Priority: Minor
Reporter: Niu Yawei (Inactive) Assignee: Niu Yawei (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-6831 The ticket for tracking all DNE2 bugs Reopened
Severity: 3
Rank (Obsolete): 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().



 Comments   
Comment by Di Wang [ 14/Aug/15 ]

Niu: could you please help here? thanks

Comment by Gerrit Updater [ 23/Jun/16 ]

Niu Yawei (yawei.niu@intel.com) uploaded a new patch: http://review.whamcloud.com/20941
Subject: LU-6888 osp: check return value in osp_update_request_create()
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: f58f80798b9db95f5ba6c2590b865784e431c61f

Comment by Gerrit Updater [ 27/Jul/16 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/20941/
Subject: LU-6888 osp: check return value in osp_update_request_create()
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: e2462a1286fb83dd7c0362ac8f88d380c058f1cc

Comment by Niu Yawei (Inactive) [ 27/Jul/16 ]

patch landed for 2.9

Generated at Sat Feb 10 02:04:09 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.