Set FMODE_PREAD for stream_file
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 18 Apr 2011 16:27:35 +0000 (12:27 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 18 Apr 2011 16:27:35 +0000 (12:27 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
ltt-debugfs-abi.c

index 0ac886113c35c5711dfb6c1060aeda22ee1df0dc..f5ead59eb9a11552a9498604393af0c61e407592 100644 (file)
@@ -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
This page took 0.026321 seconds and 4 git commands to generate.