i=h.huang,nikita.danilov
do not return 0 from ll_revalidate_nd in case of error:
invalidated dentry may get recreated and
real_lookup will revalidate agai instead of lookup. That revalidate oopses
derefencing error code in the line:
nd->intent.open.file->private_data = it; because nd->intent.open.file holds
error from first revalidate.
nd->intent.open.file->private_data = it;
filp = lookup_instantiate_filp(nd, dentry,NULL);
if (IS_ERR(filp)) {
- rc = 0;
+ rc = PTR_ERR(filp);
}
#else
nd->intent.open.file->private_data = it;