From 409453cb173082c2dad4d46d7046e6bc1d627fa4 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 18 Apr 2011 12:27:35 -0400 Subject: [PATCH] Set FMODE_PREAD for stream_file Signed-off-by: Mathieu Desnoyers --- ltt-debugfs-abi.c | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.34.1