lkml.org 
[lkml]   [2008]   [Dec]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: RFC: Fix f_flags races without the BKL
On Mon, Dec 29, 2008 at 04:13:52AM -0700, Jonathan Corbet wrote:
> Accesses to the f_flags field have always involved a read-modify-write
> operation, and have always been racy in the absence of the BKL. The recent
> BKL-removal work made this problem worse, but it has been there for a very
> long time. The race is quite small, and, arguably, has never affected
> anybody, but it's still worth fixing.
>
> After pondering for a while, I couldn't come up with anything better than a
> global file->f_flags mutex. There's no point in bloating struct file with
> a mutex just for this purpose; it's hard to imagine that there will be any
> real contention for this lock.
Rather than open coded mutex how about adding a few helpers to
set and clear the flags and hide locking there?

Not that your patch looks invasive..

Sam


\
 
 \ /
  Last update: 2008-12-29 12:57    [W:0.241 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site