[LU-3807] unsafe error handing around ll_splice_alias() Created: 21/Aug/13  Updated: 06/Sep/13  Resolved: 06/Sep/13

Status: Closed
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.5.0
Fix Version/s: Lustre 2.5.0

Type: Bug Priority: Minor
Reporter: John Hammond Assignee: John Hammond
Resolution: Fixed Votes: 0
Labels: dcache, llite, patch

Severity: 3
Rank (Obsolete): 9839

 Description   

Under memory pressure, ll_d_init() may fail to allocate a ll_dentry_data for the passed in dentry. When this happens ll_splice_alias() will return ERR_PTR(-ENOMEM). In ll_lookup_it() via ll_statahead_enter() and ll_lookup_it_finish() (which both call ll_splice_alias()) this err pointer will be assigned to both retval and dentry. Then on the way out this invalid dentry will be passed to ll_statahead_mark() thereby causing an oops.

ll_lookup_it(parent, dentry, ...)
        ll_statahead_enter(parent, &dentry, 0)
                do_statahead_enter(parent, &dentry, 0)
                        dentry = ll_splice_alias(parent, dentry)
                                ll_d_init(dentry)
        ll_lookup_it_finish(parent, &dentry,...)
                        dentry = ll_splice_alias(parent, dentry)
                                ll_d_init(dentry)

A similar situation may exist in ll_revalidate_nd().



 Comments   
Comment by Swapnil Pimpale (Inactive) [ 27/Aug/13 ]

I have added a patch to fix this issue --> http://review.whamcloud.com/#/c/7460/

Comment by John Hammond [ 06/Sep/13 ]

Patch landed to master. Thanks Swapnil.

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