lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 19 May 2018 19:17:59 -0300
From:   Marcelo Ricardo Leitner <marcelo.leitner@...il.com>
To:     Vlad Buslov <vladbu@...lanox.com>
Cc:     netdev@...r.kernel.org, davem@...emloft.net, jhs@...atatu.com,
        xiyou.wangcong@...il.com, jiri@...nulli.us, pablo@...filter.org,
        kadlec@...ckhole.kfki.hu, fw@...len.de, ast@...nel.org,
        daniel@...earbox.net, edumazet@...gle.com, keescook@...omium.org,
        linux-kernel@...r.kernel.org, netfilter-devel@...r.kernel.org,
        coreteam@...filter.org, kliteyn@...lanox.com
Subject: Re: [PATCH 10/14] net: sched: extend act API for lockless actions

Please use a more meaningful patch summary. This one is too generic.

On Mon, May 14, 2018 at 05:27:11PM +0300, Vlad Buslov wrote:
...
> +int tcf_idr_find_delete(struct tc_action_net *tn, u32 index)

What about naming it tcf_idr_delete_index() instead?
The find operation is always implicit when you don't specify the
object itself directly, and then it describes which key will be used.

> +{
> +	struct tcf_idrinfo *idrinfo = tn->idrinfo;
> +	struct tc_action *p;
> +	int ret = 0;
> +
> +	spin_lock_bh(&idrinfo->lock);
> +	p = idr_find(&idrinfo->action_idr, index);
> +	if (!p) {
> +		spin_unlock(&idrinfo->lock);
> +		return -ENOENT;
> +	}
> +
> +	if (!atomic_read(&p->tcfa_bindcnt)) {
> +		if (refcount_dec_and_test(&p->tcfa_refcnt)) {
> +			struct module *owner = p->ops->owner;
> +
> +			WARN_ON(p != idr_remove(&idrinfo->action_idr,
> +						p->tcfa_index));
> +			spin_unlock_bh(&idrinfo->lock);
> +
> +			tcf_action_cleanup(p);
> +			module_put(owner);
> +			return 0;
> +		}
> +		ret = 0;
> +	} else {
> +		ret = -EPERM;
> +	}
> +
> +	spin_unlock_bh(&idrinfo->lock);
> +	return ret;
> +}
> +EXPORT_SYMBOL(tcf_idr_find_delete);
...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ