[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <thzkgbuwuo3knevpipu4rzsh5qgmwhklihypdgziiruabvh46f@uwdkpcfxgloo>
Date: Mon, 10 Jun 2024 20:30:58 -0400
From: Kent Overstreet <kent.overstreet@...ux.dev>
To: Kuniyuki Iwashima <kuniyu@...zon.com>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
kuni1840@...il.com, netdev@...r.kernel.org, pabeni@...hat.com
Subject: Re: [PATCH v1 net-next 01/11] af_unix: Define locking order for
unix_table_double_lock().
On Mon, Jun 10, 2024 at 04:58:36PM -0700, Kuniyuki Iwashima wrote:
> > No, we're defining an ordering, there's no need for an enum - this
> > should work exactly the same as a comparison function that you pass to
> > sort().
> >
> > Comparison functions are no place to get fancy, they should be as
> > standard as possible: you can get _crazy_ bugs resulting from buggy
> > comparison functions that don't actually define a total ordering.
>
> What should it return if we cannot define the total ordering like
> when we only define the allowed list of ordering ?
>
> See patch 8, the rule there is
>
> if the nested order is listening socket -> child socket, then ok,
> and otherwise, not.
>
> So we don't know the clear ordering, equal or greater, but we know
> it's actually illegal.
>
> https://lore.kernel.org/netdev/20240610223501.73191-9-kuniyu@amazon.com/
Ok yeah, that's a tricky one, and it does come up elsewhere. I think we
can allow comparison functions to return "undefined", and define 0 ==
undefined for lockdep.
The important thing I want to maintain is that comparison functions be
symmetric.
Powered by blists - more mailing lists