On Fri, May 25, 2012 at 01:57:41PM -0700, Kent Overstreet wrote:
> Change-Id: I676968e201f0de9a0d0a7813e2fcc6873343e8c3
> 
> Signed-off-by: Kent Overstreet <[email protected]>

You know what I was gonna complain about here, right?  :)

>  struct request *elv_rb_find(struct rb_root *root, sector_t sector)
>  {
> -     struct rb_node *n = root->rb_node;
> -     struct request *rq;
> -
> -     while (n) {
> -             rq = rb_entry(n, struct request, rb_node);
> +     struct request search = { .__sector = sector };

This is dangerous.  You can't put things like struct request on stack.
It might look like it's working ok on the tested setup but archs
differ in stack pressure and more importantly people may add
arbitrarily sized fields, including debugging stuff, to struct
request.  So, no, please don't do that.

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to