xfs-masters
[Top] [All Lists]

Re: RFC: Fix f_flags races without the BKL

To: Sam Ravnborg <sam@xxxxxxxxxxxx>
Subject: Re: RFC: Fix f_flags races without the BKL
From: Jonathan Corbet <corbet@xxxxxxx>
Date: Tue, 30 Dec 2008 05:49:46 -0700
Cc: LKML <linux-kernel@xxxxxxxxxxxxxxx>, Andi Kleen <andi@xxxxxxxxxxxxxx>, Alan Cox <alan@xxxxxxxxxxxxxxxxxxx>, Al Viro <viro@xxxxxxxxxxxxxxxxxx>, Oleg Nesterov <oleg@xxxxxxxxxx>, bfields@xxxxxxxxxxxx, xfs-masters@xxxxxxxxxxx
In-reply-to: <20081229115706.GA955@xxxxxxxxxxxxxxxxxxx>
Organization: LWN.net
References: <20081229041352.6bbdf57c@tpl> <20081229115706.GA955@xxxxxxxxxxxxxxxxxxx>
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

<Prev in Thread] Current Thread [Next in Thread>