diff --git a/lustre/include/lustre_dlm.h b/lustre/include/lustre_dlm.h
index 393f9660ef3f19da40b15c87d252ad75f86e611a..7e021b2583705740941d18c4936df970728282e8 100644
--- a/lustre/include/lustre_dlm.h
+++ b/lustre/include/lustre_dlm.h
@@ -298,9 +298,12 @@ typedef enum {
 struct ldlm_namespace {
         char                  *ns_name;
         ldlm_side_t            ns_client; /* is this a client-side lock tree? */
-        __u64                  ns_connect_flags; /* client side connect flags 
-                                                  * supported by server */
-        struct list_head      *ns_hash; /* hash table for ns */
+        __u64                  ns_connect_flags; /* ns connect flags supported
+                                           * by server (may be changed via proc,
+                                           * lru resize may be disabled/enabled) */
+        __u64                  ns_orig_connect_flags; /* client side orig connect
+                                           * flags supported by server */
+        struct list_head      *ns_hash;   /* hash table for ns */
         spinlock_t             ns_hash_lock;
         __u32                  ns_refcount; /* count of resources in the hash */
         struct list_head       ns_root_list; /* all root resources in ns */
diff --git a/lustre/ldlm/ldlm_lock.c b/lustre/ldlm/ldlm_lock.c
index e83d3966b947444b3b49ee0a80054289ccb82535..4f9be3424f53e9ca63243b1091fd686729141e67 100644
--- a/lustre/ldlm/ldlm_lock.c
+++ b/lustre/ldlm/ldlm_lock.c
@@ -632,7 +632,7 @@ void ldlm_lock_decref_internal(struct ldlm_lock *lock, __u32 mode)
                  * are not supported by the server, otherwise, it is done on 
                  * enqueue. */
                 if (!exp_connect_cancelset(lock->l_conn_export) && 
-                    !exp_connect_lru_resize(lock->l_conn_export))
+                    !ns_connect_lru_resize(ns))
                         ldlm_cancel_lru(ns, 0, LDLM_ASYNC);
         } else {
                 unlock_res_and_lock(lock);
diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c
index 8aff2f612f83681e92214f2ed921eb28cb4bbcb7..c1d2b6de10bea56d90564bea23822342cdba409d 100644
--- a/lustre/ldlm/ldlm_request.c
+++ b/lustre/ldlm/ldlm_request.c
@@ -522,7 +522,7 @@ struct ptlrpc_request *ldlm_prep_enqueue_req(struct obd_export *exp,
                  * rpc right on enqueue, what will make it slower, vs. 
                  * asynchronous rpc in blocking thread. */
                 count += ldlm_cancel_lru_local(ns, cancels,
-                                               exp_connect_lru_resize(exp) ? 0 : 1,
+                                               ns_connect_lru_resize(ns) ? 0 : 1,
                                                avail - count, LDLM_CANCEL_AGED);
                 size[DLM_LOCKREQ_OFF] =
                         ldlm_request_bufsize(count, LDLM_ENQUEUE);
diff --git a/lustre/ldlm/ldlm_resource.c b/lustre/ldlm/ldlm_resource.c
index 4f68aed22fb71069a83b19082e6a9ee6e91504ed..1a2e3de52ea69bb581e37cbe3fcf8da74f7f6a71 100644
--- a/lustre/ldlm/ldlm_resource.c
+++ b/lustre/ldlm/ldlm_resource.c
@@ -138,6 +138,7 @@ static int lprocfs_wr_lru_size(struct file *file, const char *buffer,
         struct ldlm_namespace *ns = data;
         char dummy[MAX_STRING_SIZE + 1], *end;
         unsigned long tmp;
+        int lru_resize;
 
         dummy[MAX_STRING_SIZE] = '\0';
         if (copy_from_user(dummy, buffer, MAX_STRING_SIZE))
@@ -172,8 +173,12 @@ static int lprocfs_wr_lru_size(struct file *file, const char *buffer,
                 CERROR("invalid value written\n");
                 return -EINVAL;
         }
-
+        lru_resize = (tmp == 0);
+        
         if (ns_connect_lru_resize(ns)) {
+                if (!lru_resize)
+                        ns->ns_max_unused = (unsigned int)tmp;
+                        
                 if (tmp > ns->ns_nr_unused)
                         tmp = ns->ns_nr_unused;
                 tmp = ns->ns_nr_unused - tmp;
@@ -181,11 +186,26 @@ static int lprocfs_wr_lru_size(struct file *file, const char *buffer,
                 CDEBUG(D_DLMTRACE, "changing namespace %s unused locks from %u to %u\n", 
                        ns->ns_name, ns->ns_nr_unused, (unsigned int)tmp);
                 ldlm_cancel_lru(ns, (unsigned int)tmp, LDLM_ASYNC);
+                
+                if (!lru_resize) {
+                        CDEBUG(D_DLMTRACE, "disable lru_resize for namespace %s\n", 
+                               ns->ns_name);
+                        ns->ns_connect_flags &= ~OBD_CONNECT_LRU_RESIZE;
+                }
         } else {
                 CDEBUG(D_DLMTRACE, "changing namespace %s max_unused from %u to %u\n",
                        ns->ns_name, ns->ns_max_unused, (unsigned int)tmp);
                 ns->ns_max_unused = (unsigned int)tmp;
                 ldlm_cancel_lru(ns, 0, LDLM_ASYNC);
+                
+                /* Make sure that originally lru resize was supported before 
+                 * turning it on here. */
+                if (lru_resize && 
+                    (ns->ns_orig_connect_flags & OBD_CONNECT_LRU_RESIZE)) {
+                        CDEBUG(D_DLMTRACE, "enable lru_resize for namespace %s\n", 
+                               ns->ns_name);
+                        ns->ns_connect_flags |= OBD_CONNECT_LRU_RESIZE;
+                }
         }
 
         return count;
@@ -289,6 +309,7 @@ struct ldlm_namespace *ldlm_namespace_new(char *name, ldlm_side_t client,
         ns->ns_max_unused = LDLM_DEFAULT_LRU_SIZE;
         ns->ns_max_age = LDLM_DEFAULT_MAX_ALIVE;
         spin_lock_init(&ns->ns_unused_lock);
+        ns->ns_orig_connect_flags = 0;
         ns->ns_connect_flags = 0;
         ldlm_proc_namespace(ns);
 
diff --git a/lustre/ptlrpc/import.c b/lustre/ptlrpc/import.c
index 35a8aa8782508f9e918791ce3a2c3341c1b22167..25978724348edef4ff9ee3223ec1cb1ab9fd831a 100644
--- a/lustre/ptlrpc/import.c
+++ b/lustre/ptlrpc/import.c
@@ -776,6 +776,8 @@ finish:
 
                 imp->imp_obd->obd_namespace->ns_connect_flags = 
                                                         ocd->ocd_connect_flags;
+                imp->imp_obd->obd_namespace->ns_orig_connect_flags = 
+                                                        ocd->ocd_connect_flags;
 
                 LASSERT((cli->cl_max_pages_per_rpc <= PTLRPC_MAX_BRW_PAGES) &&
                         (cli->cl_max_pages_per_rpc > 0));