2005-01-31 13:03:36

by Armin Schindler

[permalink] [raw]
Subject: [PATCH 1/3] 2.6 ISDN Eicon driver: add missing uaccess

This patch adds asm/uaccess.h to files which uses copy_to/from_user()
and adds the use of the drivers internal API call to copy_to/from_user()
in platform independent code.

Signed-off-by: Armin Schindler <[email protected]>


diff -Nur linux.orig/drivers/isdn/hardware/eicon/divamnt.c linux/drivers/isdn/hardware/eicon/divamnt.c
--- linux.orig/drivers/isdn/hardware/eicon/divamnt.c 2005-01-31 12:34:17.668288724 +0100
+++ linux/drivers/isdn/hardware/eicon/divamnt.c 2005-01-31 13:22:46.887318527 +0100
@@ -1,4 +1,4 @@
-/* $Id: divamnt.c,v 1.32.6.5 2004/08/28 20:03:53 armin Exp $
+/* $Id: divamnt.c,v 1.32.6.9 2005/01/31 12:22:20 armin Exp $
*
* Driver for Eicon DIVA Server ISDN cards.
* Maint module
@@ -18,13 +18,14 @@
#include <linux/smp_lock.h>
#include <linux/poll.h>
#include <linux/devfs_fs_kernel.h>
+#include <asm/uaccess.h>

#include "platform.h"
#include "di_defs.h"
#include "divasync.h"
#include "debug_if.h"

-static char *main_revision = "$Revision: 1.32.6.5 $";
+static char *main_revision = "$Revision: 1.32.6.9 $";

static int major;

diff -Nur linux.orig/drivers/isdn/hardware/eicon/divasi.c linux/drivers/isdn/hardware/eicon/divasi.c
--- linux.orig/drivers/isdn/hardware/eicon/divasi.c 2005-01-31 12:33:40.075790246 +0100
+++ linux/drivers/isdn/hardware/eicon/divasi.c 2005-01-31 13:22:46.887318527 +0100
@@ -1,4 +1,4 @@
-/* $Id: divasi.c,v 1.25 2003/09/09 06:46:29 schindler Exp $
+/* $Id: divasi.c,v 1.25.6.2 2005/01/31 12:22:20 armin Exp $
*
* Driver for Eicon DIVA Server ISDN cards.
* User Mode IDI Interface
@@ -20,6 +20,7 @@
#include <linux/proc_fs.h>
#include <linux/skbuff.h>
#include <linux/devfs_fs_kernel.h>
+#include <asm/uaccess.h>

#include "platform.h"
#include "di_defs.h"
@@ -27,7 +28,7 @@
#include "um_xdi.h"
#include "um_idi.h"

-static char *main_revision = "$Revision: 1.25 $";
+static char *main_revision = "$Revision: 1.25.6.2 $";

static int major;

diff -Nur linux.orig/drivers/isdn/hardware/eicon/divasproc.c linux/drivers/isdn/hardware/eicon/divasproc.c
--- linux.orig/drivers/isdn/hardware/eicon/divasproc.c 2005-01-31 12:35:17.717098225 +0100
+++ linux/drivers/isdn/hardware/eicon/divasproc.c 2005-01-31 13:22:46.888318407 +0100
@@ -1,4 +1,4 @@
-/* $Id: divasproc.c,v 1.19 2004/03/21 17:26:01 armin Exp $
+/* $Id: divasproc.c,v 1.19.4.3 2005/01/31 12:22:20 armin Exp $
*
* Low level driver for Eicon DIVA Server ISDN cards.
* /proc functions
@@ -16,6 +16,7 @@
#include <linux/poll.h>
#include <linux/proc_fs.h>
#include <linux/list.h>
+#include <asm/uaccess.h>

#include "platform.h"
#include "debuglib.h"
diff -Nur linux.orig/drivers/isdn/hardware/eicon/mntfunc.c linux/drivers/isdn/hardware/eicon/mntfunc.c
--- linux.orig/drivers/isdn/hardware/eicon/mntfunc.c 2005-01-31 12:32:26.210635302 +0100
+++ linux/drivers/isdn/hardware/eicon/mntfunc.c 2005-01-31 13:22:46.896317449 +0100
@@ -1,4 +1,4 @@
-/* $Id: mntfunc.c,v 1.19.6.2 2004/08/28 20:03:53 armin Exp $
+/* $Id: mntfunc.c,v 1.19.6.4 2005/01/31 12:22:20 armin Exp $
*
* Driver for Eicon DIVA Server ISDN cards.
* Maint module
@@ -187,7 +187,7 @@
if (!mask) {
ret = diva_set_trace_filter (1, "*");
} else if (mask < sizeof(data)) {
- if (copy_from_user(data, (char __user *)buf+12, mask)) {
+ if (diva_os_copy_from_user(NULL, data, (char __user *)buf+12, mask)) {
ret = -EFAULT;
} else {
ret = diva_set_trace_filter ((int)mask, data);
@@ -199,7 +199,7 @@

case DITRACE_READ_SELECTIVE_TRACE_FILTER:
if ((ret = diva_get_trace_filter (sizeof(data), data)) > 0) {
- if (copy_to_user (buf, data, ret))
+ if (diva_os_copy_to_user (NULL, buf, data, ret))
ret = -EFAULT;
} else {
ret = -ENODEV;


2005-01-31 14:41:57

by Eric Dumazet

[permalink] [raw]
Subject: [PATCH] Time to change NR_OPEN value

Time has come to change NR_OPEN value, some production servers hit the
not so 'ridiculously high value' of 1024*1024 file descriptors per process.

AFAIK this is safe to raise this value, because alloc_fd_array() uses
vmalloc() for large arrays and vmalloc() returns NULL if a too large
allocation is attempted (or in case of memory shortage)

Signed-off-by: Eric Dumazet <[email protected]>

diff -Nru /tmp/fs.h include/linux/fs.h
--- linux.orig/include/linux/fs.h 2005-01-31 15:28:01.926685144 +0100
+++ inux/include/linux/fs.h 2005-01-31 15:29:37.047224624 +0100
@@ -32,7 +32,8 @@
* It's silly to have NR_OPEN bigger than NR_FILE, but you can change
* the file limit at runtime and only root can increase the per-process
* nr_file rlimit, so it's safe to set up a ridiculously high absolute
- * upper limit on files-per-process.
+ * upper limit on files-per-process. Actual limit depends on vmalloc()
+ * constraints.
*
* Some programs (notably those using select()) may have to be
* recompiled to take full advantage of the new limits..
@@ -40,7 +41,7 @@

/* Fixed constants first: */
#undef NR_OPEN
-#define NR_OPEN (1024*1024) /* Absolute upper limit on fd num */
+#define NR_OPEN (16*1024*1024) /* Absolute upper limit on fd num */
#define INR_OPEN 1024 /* Initial setting for nfile rlimits */

#define BLOCK_SIZE_BITS 10