[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190302005129.4d4508c9@redhat.com>
Date: Sat, 2 Mar 2019 00:51:29 +0100
From: Stefano Brivio <sbrivio@...hat.com>
To: Vlad Buslov <vladbu@...lanox.com>
Cc: netdev@...r.kernel.org, jhs@...atatu.com, xiyou.wangcong@...il.com,
jiri@...nulli.us, davem@...emloft.net
Subject: Re: [PATCH net-next v2 04/12] net: sched: flower: track filter
deletion with flag
Hi Vlad,
On Wed, 27 Feb 2019 12:12:18 +0200
Vlad Buslov <vladbu@...lanox.com> wrote:
> -static bool __fl_delete(struct tcf_proto *tp, struct cls_fl_filter *f,
> - struct netlink_ext_ack *extack)
> +static int __fl_delete(struct tcf_proto *tp, struct cls_fl_filter *f,
> + bool *last, struct netlink_ext_ack *extack)
> {
> struct cls_fl_head *head = fl_head_dereference(tp);
> bool async = tcf_exts_get_net(&f->exts);
> - bool last;
>
> + *last = false;
> +
> + if (f->deleted)
> + return -ENOENT;
> +
> + f->deleted = true;
Now that I can read this more easily :) I have a doubt: you say this
flag "prevent[s] double deletion of filter by concurrent tasks".
However, if this has no further protections (which I can't readily
see), I think this is racy:
task 1 task 2
if (f->deleted) [false]
if (f->deleted) [false]
f->deleted = true; f->deleted = true;
what am I missing here?
--
Stefano
Powered by blists - more mailing lists