Set FMODE_PREAD for stream_file
[lttng-modules.git] / 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.02426 seconds and 4 git commands to generate.