Messages in this thread | | | Date | Wed, 31 Dec 2008 02:52:20 -0700 | From | Jonathan Corbet <> | Subject | Re: [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
| |