From 388ba0981b885a4772744851d6a94362108ab438 Mon Sep 17 00:00:00 2001 From: Ludovic Stordeur Date: Mon, 11 Jul 2011 13:59:54 +0000 Subject: [PATCH] Added CIFS timeout patch for Linux 2.6.{25 --> 28} svn path=/nixpkgs/trunk/; revision=27713 --- .../linux/kernel/cifs-timeout-2.6.25.patch | 46 +++++++++++++++++++ pkgs/os-specific/linux/kernel/patches.nix | 6 +++ 2 files changed, 52 insertions(+) create mode 100644 pkgs/os-specific/linux/kernel/cifs-timeout-2.6.25.patch diff --git a/pkgs/os-specific/linux/kernel/cifs-timeout-2.6.25.patch b/pkgs/os-specific/linux/kernel/cifs-timeout-2.6.25.patch new file mode 100644 index 000000000000..1c9544ae1dfd --- /dev/null +++ b/pkgs/os-specific/linux/kernel/cifs-timeout-2.6.25.patch @@ -0,0 +1,46 @@ +--- /tmp/linux-2.6.32.14/fs/cifs/transport.c 2011-04-07 10:50:40.844188400 +0200 ++++ linux-2.6.32.14/fs/cifs/transport.c 2011-04-07 10:52:22.092690465 +0200 +@@ -277,9 +277,9 @@ + n_vec - first_vec, total_len); + if ((rc == -ENOSPC) || (rc == -EAGAIN)) { + i++; +- if (i >= 14) { ++ if (i >= 119) { + cERROR(1, +- ("sends on sock %p stuck for 15 seconds", ++ ("sends on sock %p stuck for 120 seconds", + ssocket)); + rc = -EAGAIN; + break; +@@ -553,11 +553,11 @@ + goto out; + + if (long_op == CIFS_STD_OP) +- timeout = 15 * HZ; ++ timeout = 120 * HZ; + else if (long_op == CIFS_VLONG_OP) /* e.g. slow writes past EOF */ + timeout = 180 * HZ; + else if (long_op == CIFS_LONG_OP) +- timeout = 45 * HZ; /* should be greater than ++ timeout = 120 * HZ; /* should be greater than + servers oplock break timeout (about 43 seconds) */ + else if (long_op == CIFS_ASYNC_OP) + goto out; +@@ -744,7 +744,7 @@ + goto out; + + if (long_op == CIFS_STD_OP) +- timeout = 15 * HZ; ++ timeout = 120 * HZ; + /* wait for 15 seconds or until woken up due to response arriving or + due to last connection to this server being unmounted */ + else if (long_op == CIFS_ASYNC_OP) +@@ -752,7 +752,7 @@ + else if (long_op == CIFS_VLONG_OP) /* writes past EOF can be slow */ + timeout = 180 * HZ; + else if (long_op == CIFS_LONG_OP) +- timeout = 45 * HZ; /* should be greater than ++ timeout = 120 * HZ; /* should be greater than + servers oplock break timeout (about 43 seconds) */ + else if (long_op == CIFS_BLOCKING_OP) + timeout = 0x7FFFFFFF; /* large but no so large as to wrap */ diff --git a/pkgs/os-specific/linux/kernel/patches.nix b/pkgs/os-specific/linux/kernel/patches.nix index 62ecb55d0fc9..65400427cbe5 100644 --- a/pkgs/os-specific/linux/kernel/patches.nix +++ b/pkgs/os-specific/linux/kernel/patches.nix @@ -235,6 +235,12 @@ rec { # Increase the timeout on CIFS requests from 15 to 120 seconds to # make CIFS more resilient to high load on the CIFS server. + cifs_timeout_2_6_25 = + { name = "cifs-timeout"; + patch = ./cifs-timeout-2.6.25.patch; + features.cifsTimeout = true; + }; + cifs_timeout_2_6_29 = { name = "cifs-timeout"; patch = ./cifs-timeout-2.6.29.patch;