public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizf@cn.fujitsu.com>
To: Tom Zanussi <tzanussi@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
	Steven Rostedt <rostedt@goodmis.org>,
	paulmck@linux.vnet.ibm.com
Subject: Re: [PATCH] tracing/filters: add filter_mutex to protect filter predicates
Date: Thu, 16 Apr 2009 16:33:30 +0800	[thread overview]
Message-ID: <49E6ED5A.6080003@cn.fujitsu.com> (raw)
In-Reply-To: <1239863904.6903.12.camel@tropicana>

Tom Zanussi wrote:
> This patch adds a filter_mutex to prevent the filter predicates from
> being accessed concurrently by various external functions.
> 
> It's based on a previous patch by Li Zefan:
>         "[PATCH 7/7] tracing/filters: make filter preds RCU safe"
> 
> but any problems with it were added by me. ;-)
> 
> Signed-off-by: Tom Zanussi <tzanussi@gmail.com>
> 

Reviewed-and-tested-by: Li Zefan <lizf@cn.fujitsu.com>

except:

> @@ -348,17 +399,15 @@ int filter_add_subsystem_pred(struct event_subsystem *system,
>  		if (strcmp(call->system, system->name))
>  			continue;
>  
> -		if (!find_event_field(call, pred->field_name))
> -			continue;
> -
> -		err = filter_add_pred(call, pred);
> +		err = __filter_add_pred(call, pred);
>  		if (err == -ENOMEM) {
>  			system->preds[system->n_preds] = NULL;
> -			return err;
> +			system->n_preds--;
> +			break;

now we return 0 but not ENOMEM in this failure case.

>  		}
>  	}
>  
> -	system->n_preds++;
> +	mutex_unlock(&filter_mutex);
>  
>  	return 0;
>  }


  reply	other threads:[~2009-04-16  8:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-16  6:38 [PATCH] tracing/filters: add filter_mutex to protect filter predicates Tom Zanussi
2009-04-16  8:33 ` Li Zefan [this message]
2009-04-17  0:31   ` Ingo Molnar
2009-04-16 16:17 ` Frederic Weisbecker

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=49E6ED5A.6080003@cn.fujitsu.com \
    --to=lizf@cn.fujitsu.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=rostedt@goodmis.org \
    --cc=tzanussi@gmail.com \
    /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