[LU-1399] lustre_cfg_new should return NULL instead of ERR_PTR(-ENOMEM) Created: 11/May/12  Updated: 30/Dec/14  Resolved: 30/Dec/14

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

Type: Bug Priority: Minor
Reporter: Isaac Huang (Inactive) Assignee: Dmitry Eremin (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 9750

 Description   

lustre_cfg_new() currently returns ERR_PTR(-ENOMEM) at allocation failure, but all callers except one checks its return against NULL. As there's no other error to return, I think lustre_cfg_new() should simply return NULL rather than error coded pointers.

Also, a minor issue in ptlrpc_check_status(), the console message suppression branch will never be entered and thus is rendered useless.

A patch will follow shortly to fix them.



 Comments   
Comment by Isaac Huang (Inactive) [ 11/May/12 ]

Patch posted to http://review.whamcloud.com/2724

Comment by Andreas Dilger [ 17/Jun/14 ]

Above patch was abandoned, but there are still some cases where lustre_cfg_new() can return NULL and not be checked.

http://review.whamcloud.com/10739

Comment by Gerrit Updater [ 26/Dec/14 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/10739/
Subject: LU-1399 config: check lustre_cfg_new() return
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 2d15edc7be83555a7fa17a666d99b6af4922ab82

Comment by Dmitry Eremin (Inactive) [ 30/Dec/14 ]

Patch landed to master

Generated at Sat Feb 10 01:16:17 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.