Skip to content

Commit

Permalink
tracing: Update *ppos instead of filp->f_pos
Browse files Browse the repository at this point in the history
Instead of directly updating filp->f_pos we should update the *ppos
argument. The filp->f_pos gets updated within the file_pos_write()
function called from sys_write().

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20091023233646.399670810@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Jiri Olsa authored and Ingo Molnar committed Oct 24, 2009
1 parent 964fe08 commit cf8517c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ ftrace_profile_write(struct file *filp, const char __user *ubuf,
out:
mutex_unlock(&ftrace_profile_lock);

filp->f_pos += cnt;
*ppos += cnt;

return cnt;
}
Expand Down
8 changes: 4 additions & 4 deletions kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -2440,7 +2440,7 @@ tracing_trace_options_write(struct file *filp, const char __user *ubuf,
return ret;
}

filp->f_pos += cnt;
*ppos += cnt;

return cnt;
}
Expand Down Expand Up @@ -2582,7 +2582,7 @@ tracing_ctrl_write(struct file *filp, const char __user *ubuf,
}
mutex_unlock(&trace_types_lock);

filp->f_pos += cnt;
*ppos += cnt;

return cnt;
}
Expand Down Expand Up @@ -2764,7 +2764,7 @@ tracing_set_trace_write(struct file *filp, const char __user *ubuf,
if (err)
return err;

filp->f_pos += ret;
*ppos += ret;

return ret;
}
Expand Down Expand Up @@ -3299,7 +3299,7 @@ tracing_entries_write(struct file *filp, const char __user *ubuf,
}
}

filp->f_pos += cnt;
*ppos += cnt;

/* If check pages failed, return ENOMEM */
if (tracing_disabled)
Expand Down

0 comments on commit cf8517c

Please sign in to comment.