lkml.org 
[lkml]   [2008]   [Dec]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [xfs-masters] RFC: Fix f_flags races without the BKL
On Tue, 30 Dec 2008 15:48:37 +0100
Christoph Hellwig <hch@lst.de> wrote:

> That beeing said I took another look at the patch and it seems like
> most places are indeed just very quick flags setting / clearing
> with the only sleeping possible inside ->fasync. So having a
> file_flags_lock spinlock, and another sleeping mutex protecting
> ->fasync might be another options.
>
> Jon, do you remember what we actually need to protect in -fasync?
> any reason not to take the locking inside the method? Together with
> ->lock and the old ->ioctl it's pretty special in fops as none of
> the others have any locking at all.

There's nothing special about fasync() itself. The problem is that the
setting of the FASYNC flag and the associated call to fasync() need to
be atomic, lest the driver/filesystem and the VFS end up with differing
ideas about the setting of that flag. In the absence of that
constraint, one could just use the normal bit operations on f_flags.

jon


\
 
 \ /
  Last update: 2008-12-31 10:55    [W:0.406 / U:3.984 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site