Re: RFC: Fix f_flags races without the BKL

From: Oleg Nesterov
Date: Fri Jan 09 2009 - 09:06:26 EST


On 01/09, Jonathan Corbet wrote:
>
> On Fri, 9 Jan 2009 11:08:21 +0100
> Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
>
> > and then we change f_flags again, including F_ASYNC bit.
> >
> > This is racy?
>
> No, I took FASYNC out of SETFL_MASK, so it isn't changed here.

Ah yes, I missed the change in SETFL_MASK. Thanks.

> > Now we have the global mutex for ->fasync... Well, not very
> > good but fasync_helper() takes fasync_lock anyway.
>
> Not very good, but does anybody know of a workload which would result in
> that mutex being contended ever?

I don't.

Actually, I personally dislike the global file_flags_lock more.
But don't get me wrong, I do not think O_LOCK_FLAGS is better
or cleaner.

Oleg.

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