[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171115081407.GA13745@nanopsycho.orion>
Date: Wed, 15 Nov 2017 09:14:07 +0100
From: Jiri Pirko <jiri@...nulli.us>
To: Jakub Kicinski <jakub.kicinski@...ronome.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net, mlxsw@...lanox.com,
andrew@...n.ch, vivien.didelot@...oirfairelinux.com,
f.fainelli@...il.com, michael.chan@...adcom.com,
ganeshgr@...lsio.com, saeedm@...lanox.com, matanb@...lanox.com,
leonro@...lanox.com, idosch@...lanox.com, ast@...nel.org,
daniel@...earbox.net, simon.horman@...ronome.com,
pieter.jansenvanvuuren@...ronome.com, john.hurley@...ronome.com,
alexander.h.duyck@...el.com, linville@...driver.com,
gospo@...adcom.com, steven.lin1@...adcom.com, yuvalm@...lanox.com,
ogerlitz@...lanox.com, dsa@...ulusnetworks.com,
roopa@...ulusnetworks.com
Subject: Re: [patch net-next RFC v2 03/11] devlink: Add support for reload
Wed, Nov 15, 2017 at 09:03:59AM CET, jakub.kicinski@...ronome.com wrote:
>On Tue, 14 Nov 2017 17:18:44 +0100, Jiri Pirko wrote:
>> +static int devlink_nl_cmd_reload(struct sk_buff *skb, struct genl_info *info)
>> +{
>> + struct devlink *devlink = info->user_ptr[0];
>> + int err;
>> +
>> + if (!devlink->ops->reload)
>> + return -EOPNOTSUPP;
>> +
>> + err = devlink_resources_validate(devlink, NULL, info);
>> + if (err)
>> + return err;
>> +
>> + mutex_unlock(&devlink->lock);
>> + err = devlink->ops->reload(devlink);
>> + mutex_lock(&devlink->lock);
>> +
>> + return err;
>> +}
>
>I'm a bit confused with the locking, why is devlink->lock not held
>around the validation?
It is.
Powered by blists - more mailing lists