From: Steven Rostedt Date: Thu, 23 Jul 2009 03:29:30 +0000 (-0400) Subject: tracing: only truncate ftrace files when O_TRUNC is set X-Git-Tag: v2.6.31-rc6~77^2~4 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8650ae32ef7045e763825dee6256dde7f331bb85;p=pandora-kernel.git tracing: only truncate ftrace files when O_TRUNC is set The current code will truncate the ftrace files contents if O_APPEND is not set and the file is opened in write mode. This is incorrect. It should only truncate the file if O_TRUNC is set. Otherwise if one of these files is opened by a C program with fopen "r+", it will incorrectly truncate the file. Reported-by: Jiri Olsa Signed-off-by: Steven Rostedt --- Reading git-diff-tree failed