All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Sowden <jeremy@azazel.net>
To: "Grzegorz Kuczyński" <grzegorz.kuczynski@interia.eu>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] xtables-addons 3.18 condition - Improved network namespace support
Date: Sun, 22 Aug 2021 17:34:41 +0100	[thread overview]
Message-ID: <YSJ8ocdMzhJG1Idt@azazel.net> (raw)
In-Reply-To: <61659029-f22f-0036-7bda-46fe24352d30@interia.eu>

[-- Attachment #1: Type: text/plain, Size: 1845 bytes --]

On 2021-08-22, at 18:14:13 +0200, Grzegorz Kuczyński wrote:
> My intention was removed special var 'after_clear'. The main idea was
> use a list as a flag.
>
> But Jeremy has right, I used list_empty_careful() in wrong place.
> I can change this for that:
>
>         static void condition_mt_destroy(const struct xt_mtdtor_param *par)
>         {
>                 const struct xt_condition_mtinfo *info = par->matchinfo;
>                 struct condition_variable *var = info->condvar;
>                 struct condition_net *cnet = get_condition_pernet(par->net);
>         
>                 mutex_lock(&proc_lock);
>                 // is called after net namespace deleted?
>                 if (list_empty_careful(&cnet->conditions_list)) {
>                         mutex_unlock(&proc_lock);
>                         return;
>                 }
>                 if (--var->refcount == 0) {
>                         list_del(&var->list);
>                         remove_proc_entry(var->name, cnet->proc_net_condition);
>                         mutex_unlock(&proc_lock);
>                         kfree(var);
>                         return;
>                 }
>                 mutex_unlock(&proc_lock);
>         }
>
> But now I realized that one var bool is less expensive than call a
> function.  So my improved is turned out the fail :) ... sorry for
> taking the time.

I think there are some improvements that can be made.  Will send
patches.

J.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2021-08-22 16:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-22 16:14 [PATCH] xtables-addons 3.18 condition - Improved network namespace support Grzegorz Kuczyński
2021-08-22 16:34 ` Jeremy Sowden [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-08-20 18:24 Grzegorz Kuczyński
2021-08-22 11:19 ` Jan Engelhardt
2021-08-22 11:50   ` Jeremy Sowden

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=YSJ8ocdMzhJG1Idt@azazel.net \
    --to=jeremy@azazel.net \
    --cc=grzegorz.kuczynski@interia.eu \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.