Re: [patch] eventfd - remove fput() call from possible IRQ context

From: Benjamin LaHaise
Date: Sun Mar 15 2009 - 13:44:58 EST


On Sat, Mar 14, 2009 at 06:36:34PM -0700, Davide Libenzi wrote:
> The following patch remove a possible source of fput() call from inside
> IRQ context. Myself, like Eric, wasn't able to reproduce an fput() call
> from IRQ context, but conceptually the bug is there.
> This patch adds an optimization similar to the one we already do on
> ->ki_filp, on ->ki_eventfd. Playing with ->f_count directly is not pretty
> in general, but the alternative here would be to add a brand new delayed
> fput() infrastructure, that I'm not sure is worth it.

This looks reasonably sane, the only concern I have with it is that I think
it logically makes more sense to use the same convention for fi_filp and
ki_eventfd, as the different in IS_ERR vs checking for NULL is a bit
confusing. Aside from that, it looks like it should fix the problem
correctly.

-ben
--
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/