lkml.org 
[lkml]   [2005]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC] atomic create+open
From
Date
> +/**
> + * release_open_intent - free up open intent resources
> + * @nd: pointer to nameidata
> + */
> +void release_open_intent(struct nameidata *nd)
> +{
> + if (nd->intent.open.file->f_dentry == NULL)
> + put_filp(nd->intent.open.file);
> + else
> + fput(nd->intent.open.file);
> +}
> +

This (or at least it's call site in open_namei()) should check for
IS_ERR(nd->intent.open.file).

If lookup_instantiate_filp() retuns an error and is called from
->create(), release_open_intent() will be called twice, and the second
one will Oops.

Miklos
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-10-12 17:24    [W:0.060 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site