LKML Archive on
 help / color / Atom feed
From: Al Viro <>
To: Mathieu Desnoyers <>
	Linus Torvalds <>
Subject: [tracepoint] cargo-culting considered harmful...
Date: Wed, 23 Jan 2013 22:55:24 +0000
Message-ID: <> (raw)

In samples/tracepoints/tracepoint-probe-sample.c:
 * Here the caller only guarantees locking for struct file and struct inode.
 * Locking must therefore be done in the probe to use the dentry.
static void probe_subsys_event(void *ignore,   
                               struct inode *inode, struct file *file)
        printk(KERN_INFO "Event is encountered with filename %s\n",

note that
	* file->f_path is already pinned down by open(), path_get() does not
provide anything extra.
	* file->f_path.dentry is already pinned by open() *and* path_get()
just above that dget().
	* -> *IS* *NOT* *PROTECTED* by pinning dentry down,
whether it's done once or thrice.

I do realize that it's just an example, but perhaps we should rename that
file to match the contents?  The only question is whether it should be
git mv samples/tracepoints/{tracepoint-probe-sample,cargo-cult}.c
or git mv samples cargo-cult...

					Al, seriously peeved.

             reply index

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-23 22:55 Al Viro [this message]
2013-01-23 23:02 ` Steven Rostedt
2013-01-25 14:38   ` Mathieu Desnoyers
2013-01-25 15:27     ` Steven Rostedt
2013-01-25 16:14       ` Mathieu Desnoyers
2013-01-23 23:51 ` Andrew Morton
2013-01-24  1:48   ` Al Viro
2013-01-25 14:49     ` Mathieu Desnoyers
2013-01-25 15:32       ` Al Viro
2013-01-25 17:30         ` Mathieu Desnoyers
2013-02-03 19:16 ` [tip:perf/core] tracing: Remove tracepoint sample code tip-bot for Steven Rostedt

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git
	git clone --mirror lkml/git/8.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone