Re: [RFC] atomic create+open

From: Miklos Szeredi
Date: Wed Oct 12 2005 - 10:22:41 EST


> +/**
> + * 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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/