[dahdi-commits] dahdi/linux.git branch "master" updated.

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Wed Sep 17 16:29:35 CDT 2014


branch "master" has been updated
       via  b9a8000bbd1b6120f22627c105a2c2194dcc793d (commit)
      from  eedb4bf9441ae3545a4ab74eac2d10fa57681355 (commit)

Summary of changes:
 drivers/dahdi/dahdi-base.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)


- Log -----------------------------------------------------------------
commit b9a8000bbd1b6120f22627c105a2c2194dcc793d
Author: Shaun Ruffell <sruffell at digium.com>
Date:   Tue Sep 16 16:58:44 2014 -0500

    dahdi: Fix failure to read / write on kernel 3.16+
    
    Kernel version 3.16+, since upstream commit (7f7f25e82d54870d "replace checking
    for ->read/->aio_read presence with check in ->f_mode" )[1], does not like it
    when dahdi changes the set of allowed file operations on a file descriptor
    outside of the context of an open() system call.
    
    DAHDI changes the available file operations when a channel is opened by first
    opening /dev/dahdi/channel and then calling the DAHDI_SPECIFY ioctl to bind it
    to a particular DAHDI channel. Until DAHDI_SPECIFY is called there weren't any
    read()/write() callbacks implemented and therefore after the initial open, the
    kernel was setting not setting FMODE_CAN_{WRITE,READ} on the file descriptor
    indicating that those operations were not allowed.
    
    Now define empty shell functions on the general dahdi_fops so the vfs layer will
    not mark a file descriptor as unwritteable or unreadable on open.
    
    [1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=7f7f25e82d54870df24d415a7007fbd327da027b
    
    Internal-Issue-ID: DAHLIN-340
    Reported-and-tested-by: Thomas B. Clark
    Signed-off-by: Shaun Ruffell <sruffell at digium.com>
    Signed-off-by: Russ Meyerriecks <rmeyerriecks at digium.com>

diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index d46d7eb..0892734 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -10284,6 +10284,18 @@ MODULE_PARM_DESC(auto_assign_spans,
 		 "channel numbers assigned by the driver. If 0, user space "
 		 "will need to assign them via /sys/bus/dahdi_devices.");
 
+
+static ssize_t dahdi_no_read(struct file *file, char __user *usrbuf,
+			     size_t count, loff_t *ppos)
+{
+	return -ENOSYS;
+}
+static ssize_t dahdi_no_write(struct file *file, const char __user *usrbuf,
+			      size_t count, loff_t *ppos)
+{
+	return -ENOSYS;
+}
+
 static const struct file_operations dahdi_fops = {
 	.owner   = THIS_MODULE,
 	.open    = dahdi_open,
@@ -10297,6 +10309,8 @@ static const struct file_operations dahdi_fops = {
 	.ioctl   = dahdi_ioctl,
 #endif
 	.poll    = dahdi_poll,
+	.read    = dahdi_no_read,
+	.write   = dahdi_no_write,
 };
 
 static const struct file_operations dahdi_timer_fops = {
@@ -10311,6 +10325,8 @@ static const struct file_operations dahdi_timer_fops = {
 	.ioctl   = dahdi_timer_ioctl,
 #endif
 	.poll    = dahdi_timer_poll,
+	.read    = dahdi_no_read,
+	.write   = dahdi_no_write,
 };
 
 /*

-----------------------------------------------------------------------


-- 
dahdi/linux.git



More information about the dahdi-commits mailing list