Skip to content

Commit 9b7bd05

Browse files
committed
Merge tag 'trace-v6.8-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
Pull tracing fixes from Steven Rostedt: "Two small fixes for tracefs and eventfs: - Fix register_snapshot_trigger() on allocation error If the snapshot fails to allocate, the register_snapshot_trigger() can still return success. If the call to tracing_alloc_snapshot_instance() returned anything but 0, it returned 0, but it should have been returning the error code from that allocation function. - Remove leftover code from tracefs doing a dentry walk on remount. The update_gid() function was called by the tracefs code on remount to update the gid of eventfs, but that is no longer the case, but that code wasn't deleted. Nothing calls it. Remove it" * tag 'trace-v6.8-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: tracefs: remove stale 'update_gid' code tracing/trigger: Fix to return error if failed to alloc snapshot
2 parents 6f3d7d5 + 29142dc commit 9b7bd05

File tree

3 files changed

+4
-41
lines changed

3 files changed

+4
-41
lines changed

fs/tracefs/event_inode.c

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -281,44 +281,6 @@ static void update_inode_attr(struct dentry *dentry, struct inode *inode,
281281
inode->i_gid = attr->gid;
282282
}
283283

284-
static void update_gid(struct eventfs_inode *ei, kgid_t gid, int level)
285-
{
286-
struct eventfs_inode *ei_child;
287-
288-
/* at most we have events/system/event */
289-
if (WARN_ON_ONCE(level > 3))
290-
return;
291-
292-
ei->attr.gid = gid;
293-
294-
if (ei->entry_attrs) {
295-
for (int i = 0; i < ei->nr_entries; i++) {
296-
ei->entry_attrs[i].gid = gid;
297-
}
298-
}
299-
300-
/*
301-
* Only eventfs_inode with dentries are updated, make sure
302-
* all eventfs_inodes are updated. If one of the children
303-
* do not have a dentry, this function must traverse it.
304-
*/
305-
list_for_each_entry_srcu(ei_child, &ei->children, list,
306-
srcu_read_lock_held(&eventfs_srcu)) {
307-
if (!ei_child->dentry)
308-
update_gid(ei_child, gid, level + 1);
309-
}
310-
}
311-
312-
void eventfs_update_gid(struct dentry *dentry, kgid_t gid)
313-
{
314-
struct eventfs_inode *ei = dentry->d_fsdata;
315-
int idx;
316-
317-
idx = srcu_read_lock(&eventfs_srcu);
318-
update_gid(ei, gid, 0);
319-
srcu_read_unlock(&eventfs_srcu, idx);
320-
}
321-
322284
/**
323285
* create_file - create a file in the tracefs filesystem
324286
* @name: the name of the file to create.

fs/tracefs/internal.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ struct inode *tracefs_get_inode(struct super_block *sb);
8282
struct dentry *eventfs_start_creating(const char *name, struct dentry *parent);
8383
struct dentry *eventfs_failed_creating(struct dentry *dentry);
8484
struct dentry *eventfs_end_creating(struct dentry *dentry);
85-
void eventfs_update_gid(struct dentry *dentry, kgid_t gid);
8685
void eventfs_set_ei_status_free(struct tracefs_inode *ti, struct dentry *dentry);
8786

8887
#endif /* _TRACEFS_INTERNAL_H */

kernel/trace/trace_events_trigger.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,8 +1470,10 @@ register_snapshot_trigger(char *glob,
14701470
struct event_trigger_data *data,
14711471
struct trace_event_file *file)
14721472
{
1473-
if (tracing_alloc_snapshot_instance(file->tr) != 0)
1474-
return 0;
1473+
int ret = tracing_alloc_snapshot_instance(file->tr);
1474+
1475+
if (ret < 0)
1476+
return ret;
14751477

14761478
return register_trigger(glob, data, file);
14771479
}

0 commit comments

Comments
 (0)