From: Ander Juaristi <a@juaristi.eus>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] netfilter: nft_dynset: support for element deletion
Date: Mon, 15 Jul 2019 18:22:14 +0200 [thread overview]
Message-ID: <3db3e09d-5e1e-5d12-0f96-f911eb40c769@juaristi.eus> (raw)
In-Reply-To: <20190713165940.gyqrhab4z3eookgl@breakpoint.cc>
[-- Attachment #1: Type: text/plain, Size: 874 bytes --]
On 13/7/19 18:59, Florian Westphal wrote:
>
>> + if (he == NULL)
>> + return false;
>> +
>> + rhashtable_remove_fast(&priv->ht, &he->node, nft_rhash_params);
>> + return true;
>
> Perhaps add a small comment here that rhashtable_remove_fast retval
> is ignored intentionally?
>
> I.e., don't make this return false in case two cpus race to remove same
> entry.
Hmm, this made me think. I don't know if this was all too intentional
from me.
Maybe rather than ignoring it, it would be better to return true only if
rhashtable_remove_fast returned 0, which will only happen if the element
was actually deleted (locking is done internally so two cpus cannot race
in there). Else, if return value is -ENOENT, we should return false.
And taking this reasoning further, maybe the initial call to
rhashtable_lookup wouldn't be needed either?
WDYT?
[-- Attachment #2: pEpkey.asc --]
[-- Type: application/pgp-keys, Size: 6263 bytes --]
next prev parent reply other threads:[~2019-07-15 16:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-13 16:03 [PATCH] netfilter: nft_dynset: support for element deletion Ander Juaristi
2019-07-13 16:59 ` Florian Westphal
2019-07-15 16:22 ` Ander Juaristi [this message]
2019-07-15 19:54 ` Florian Westphal
2019-08-08 20:41 ` kbuild test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3db3e09d-5e1e-5d12-0f96-f911eb40c769@juaristi.eus \
--to=a@juaristi.eus \
--cc=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).