From: Mathieu Desnoyers Date: Mon, 18 Apr 2011 16:27:35 +0000 (-0400) Subject: Set FMODE_PREAD for stream_file X-Git-Tag: v2.0-pre1~175 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=409453cb173082c2dad4d46d7046e6bc1d627fa4;p=lttng-modules.git Set FMODE_PREAD for stream_file Signed-off-by: Mathieu Desnoyers --- diff --git a/ltt-debugfs-abi.c b/ltt-debugfs-abi.c index 0ac88611..f5ead59e 100644 --- a/ltt-debugfs-abi.c +++ b/ltt-debugfs-abi.c @@ -240,6 +240,12 @@ int lttng_abi_open_stream(struct file *channel_file) ret = PTR_ERR(stream_file); goto file_error; } + /* + * OPEN_FMODE, called within anon_inode_getfile/alloc_file, don't honor + * FMODE_LSEEK, FMODE_PREAD nor FMODE_PWRITE. We need to read from this + * file descriptor, so we set FMODE_PREAD here. + */ + stream_file->f_mode = FMODE_PREAD; fd_install(stream_fd, stream_file); /* * The stream holds a reference to the channel within the generic ring