Re: [RFC] atomic create+open

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux