Re: RFC: Fix f_flags races without the BKL

From: Jonathan Corbet
Date: Tue Dec 30 2008 - 07:50:15 EST


On Mon, 29 Dec 2008 12:57:06 +0100
Sam Ravnborg <sam@xxxxxxxxxxxx> wrote:

> Rather than open coded mutex how about adding a few helpers to
> set and clear the flags and hide locking there?

There's a couple of problems with that. One being that SETFL wants to
manipulate a bunch of flags together, so a simple set_flag/clear_flag
interface won't do it. Beyond that, though, calls to the ->fasync()
function need to be atomic with respect to changes to the associated
flag.

Still, it seems that the global lock approach isn't too popular, so
I'll get back to the drawing board once I'm theoretically not on
vacation.

Thanks,

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