Commit 13b73446 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull tracing fixes from Steven Rostedt:

 - Fix another kerneldoc warning

 - Fix eventfs files to inherit the ownership of its parent directory.

   The dynamic creation of dentries in eventfs did not take into account
   if the tracefs file system was mounted with a gid/uid, and would
   still default to the gid/uid of root. This is a regression.

 - Fix warning when synthetic event testing is enabled along with
   startup event tracing testing is enabled

* tag 'trace-v6.7-rc6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
  tracing / synthetic: Disable events after testing in synth_event_gen_test_init()
  eventfs: Have event files and directories default to parent uid and gid
  tracing/synthetic: fix kernel-doc warnings
parents 7c5e046b 88b30c7f
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -148,7 +148,8 @@ static const struct file_operations eventfs_file_operations = {
	.release	= eventfs_release,
};

static void update_inode_attr(struct inode *inode, struct eventfs_attr *attr, umode_t mode)
static void update_inode_attr(struct dentry *dentry, struct inode *inode,
			      struct eventfs_attr *attr, umode_t mode)
{
	if (!attr) {
		inode->i_mode = mode;
@@ -162,9 +163,13 @@ static void update_inode_attr(struct inode *inode, struct eventfs_attr *attr, um

	if (attr->mode & EVENTFS_SAVE_UID)
		inode->i_uid = attr->uid;
	else
		inode->i_uid = d_inode(dentry->d_parent)->i_uid;

	if (attr->mode & EVENTFS_SAVE_GID)
		inode->i_gid = attr->gid;
	else
		inode->i_gid = d_inode(dentry->d_parent)->i_gid;
}

/**
@@ -206,7 +211,7 @@ static struct dentry *create_file(const char *name, umode_t mode,
		return eventfs_failed_creating(dentry);

	/* If the user updated the directory's attributes, use them */
	update_inode_attr(inode, attr, mode);
	update_inode_attr(dentry, inode, attr, mode);

	inode->i_op = &eventfs_file_inode_operations;
	inode->i_fop = fop;
@@ -242,7 +247,8 @@ static struct dentry *create_dir(struct eventfs_inode *ei, struct dentry *parent
		return eventfs_failed_creating(dentry);

	/* If the user updated the directory's attributes, use them */
	update_inode_attr(inode, &ei->attr, S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO);
	update_inode_attr(dentry, inode, &ei->attr,
			  S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO);

	inode->i_op = &eventfs_root_dir_inode_operations;
	inode->i_fop = &eventfs_file_operations;
+11 −0
Original line number Diff line number Diff line
@@ -477,6 +477,17 @@ static int __init synth_event_gen_test_init(void)

	ret = test_trace_synth_event();
	WARN_ON(ret);

	/* Disable when done */
	trace_array_set_clr_event(gen_synth_test->tr,
				  "synthetic",
				  "gen_synth_test", false);
	trace_array_set_clr_event(empty_synth_test->tr,
				  "synthetic",
				  "empty_synth_test", false);
	trace_array_set_clr_event(create_synth_test->tr,
				  "synthetic",
				  "create_synth_test", false);
 out:
	return ret;
}
+2 −2
Original line number Diff line number Diff line
@@ -1137,7 +1137,7 @@ EXPORT_SYMBOL_GPL(synth_event_add_fields);
 * @cmd: A pointer to the dynevent_cmd struct representing the new event
 * @name: The name of the synthetic event
 * @mod: The module creating the event, NULL if not created from a module
 * @args: Variable number of arg (pairs), one pair for each field
 * @...: Variable number of arg (pairs), one pair for each field
 *
 * NOTE: Users normally won't want to call this function directly, but
 * rather use the synth_event_gen_cmd_start() wrapper, which
@@ -1695,7 +1695,7 @@ __synth_event_trace_end(struct synth_event_trace_state *trace_state)
 * synth_event_trace - Trace a synthetic event
 * @file: The trace_event_file representing the synthetic event
 * @n_vals: The number of values in vals
 * @args: Variable number of args containing the event values
 * @...: Variable number of args containing the event values
 *
 * Trace a synthetic event using the values passed in the variable
 * argument list.