[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y7k13+lkw2o0Qiva@nanopsycho>
Date: Sat, 7 Jan 2023 10:05:35 +0100
From: Jiri Pirko <jiri@...nulli.us>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Jacob Keller <jacob.e.keller@...el.com>, davem@...emloft.net,
netdev@...r.kernel.org, edumazet@...gle.com, pabeni@...hat.com
Subject: Re: [PATCH net-next 4/9] devlink: always check if the devlink
instance is registered
Fri, Jan 06, 2023 at 10:19:34PM CET, kuba@...nel.org wrote:
>On Fri, 6 Jan 2023 09:03:18 -0800 Jacob Keller wrote:
>> > +static inline bool devl_is_registered(struct devlink *devlink)
>> > +{
>> > + /* To prevent races the caller must hold the instance lock
>> > + * or another lock taken during unregistration.
>> > + */
>>
>> Why not just lockdep_assert here on the instance lock? I guess this
>> comment implies that another lock could be used instead but it seems
>> weird to allow that? I guess because of things like the linecards_lock
>> as opposed to the instance lock?
>
>Yup, as discussed on the RFC - removing the regions lock specifically
>is quite tricky.
I will submit in a jiff. Will add the assert here as a part
of the patchset.
Powered by blists - more mailing lists