Skip to content

Commit 13b7344

Browse files
committed
Merge tag 'trace-v6.7-rc6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
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
2 parents 7c5e046 + 88b30c7 commit 13b7344

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

fs/tracefs/event_inode.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ static const struct file_operations eventfs_file_operations = {
148148
.release = eventfs_release,
149149
};
150150

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

163164
if (attr->mode & EVENTFS_SAVE_UID)
164165
inode->i_uid = attr->uid;
166+
else
167+
inode->i_uid = d_inode(dentry->d_parent)->i_uid;
165168

166169
if (attr->mode & EVENTFS_SAVE_GID)
167170
inode->i_gid = attr->gid;
171+
else
172+
inode->i_gid = d_inode(dentry->d_parent)->i_gid;
168173
}
169174

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

208213
/* If the user updated the directory's attributes, use them */
209-
update_inode_attr(inode, attr, mode);
214+
update_inode_attr(dentry, inode, attr, mode);
210215

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

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

247253
inode->i_op = &eventfs_root_dir_inode_operations;
248254
inode->i_fop = &eventfs_file_operations;

kernel/trace/synth_event_gen_test.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,17 @@ static int __init synth_event_gen_test_init(void)
477477

478478
ret = test_trace_synth_event();
479479
WARN_ON(ret);
480+
481+
/* Disable when done */
482+
trace_array_set_clr_event(gen_synth_test->tr,
483+
"synthetic",
484+
"gen_synth_test", false);
485+
trace_array_set_clr_event(empty_synth_test->tr,
486+
"synthetic",
487+
"empty_synth_test", false);
488+
trace_array_set_clr_event(create_synth_test->tr,
489+
"synthetic",
490+
"create_synth_test", false);
480491
out:
481492
return ret;
482493
}

kernel/trace/trace_events_synth.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,7 @@ EXPORT_SYMBOL_GPL(synth_event_add_fields);
11371137
* @cmd: A pointer to the dynevent_cmd struct representing the new event
11381138
* @name: The name of the synthetic event
11391139
* @mod: The module creating the event, NULL if not created from a module
1140-
* @args: Variable number of arg (pairs), one pair for each field
1140+
* @...: Variable number of arg (pairs), one pair for each field
11411141
*
11421142
* NOTE: Users normally won't want to call this function directly, but
11431143
* 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)
16951695
* synth_event_trace - Trace a synthetic event
16961696
* @file: The trace_event_file representing the synthetic event
16971697
* @n_vals: The number of values in vals
1698-
* @args: Variable number of args containing the event values
1698+
* @...: Variable number of args containing the event values
16991699
*
17001700
* Trace a synthetic event using the values passed in the variable
17011701
* argument list.

0 commit comments

Comments
 (0)