Whamcloud - gitweb
LU-11919 llite: Initialize cl_dirty_max_pages
[fs/lustre-release.git] / lustre / ldlm / ldlm_lib.c
index 6a5daf7..5da5999 100644 (file)
@@ -359,6 +359,7 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)
                     sizeof(server_uuid)));
 
        cli->cl_dirty_pages = 0;
+       cli->cl_dirty_max_pages = 0;
        cli->cl_avail_grant = 0;
        /* FIXME: Should limit this for the sum of all cl_dirty_max_pages. */
        /* cl_dirty_max_pages may be changed at connect time in
@@ -416,7 +417,7 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)
         * from OFD after connecting. */
        cli->cl_max_pages_per_rpc = PTLRPC_MAX_BRW_PAGES;
 
-       cli->cl_short_io_bytes = OBD_MAX_SHORT_IO_BYTES;
+       cli->cl_max_short_io_bytes = OBD_MAX_SHORT_IO_BYTES;
 
        /* set cl_chunkbits default value to PAGE_SHIFT,
         * it will be updated at OSC connection time. */
@@ -1251,7 +1252,9 @@ no_export:
                /* allow "new" MDT to be connected during recovery, since we
                 * need retrieve recovery update records from it */
                if (target->obd_recovering && !lw_client && !mds_mds_conn) {
+                       time64_t now;
                        time64_t t;
+                       char *msg;
                        int c; /* connected */
                        int i; /* in progress */
                        int k; /* known */
@@ -1263,14 +1266,22 @@ no_export:
                        s = target->obd_stale_clients;
                        t = jiffies_to_msecs(target->obd_recovery_timer.expires);
                        t /= MSEC_PER_SEC;
-                       t -= ktime_get_seconds();
+                       now = ktime_get_seconds();
+                       if (now > t) {
+                               t = now - t;
+                               msg = "already passed deadline";
+                       } else {
+                               t -= now;
+                               msg = "to recover in";
+                       }
+
                        LCONSOLE_WARN("%s: Denying connection for new client %s"
                                      "(at %s), waiting for %d known clients "
                                      "(%d recovered, %d in progress, and %d "
-                                     "evicted) to recover in %lld:%.02lld\n",
+                                     "evicted) %s %lld:%.02lld\n",
                                      target->obd_name, cluuid.uuid,
                                      libcfs_nid2str(req->rq_peer.nid), k,
-                                     c - i, i, s, t / 60, t % 60);
+                                     c - i, i, s, msg, t / 60, t % 60);
                        rc = -EBUSY;
                } else {
 dont_check_exports:
@@ -2462,11 +2473,10 @@ static int target_recovery_thread(void *arg)
                 RETURN(rc);
         }
 
-        thread->t_env = env;
-        thread->t_id = -1; /* force filter_iobuf_get/put to use local buffers */
-        env->le_ctx.lc_thread = thread;
+       thread->t_env = env;
+       thread->t_id = -1; /* force filter_iobuf_get/put to use local buffers */
+       env->le_ctx.lc_thread = thread;
        tgt_io_thread_init(thread); /* init thread_big_cache for IO requests */
-       thread->t_watchdog = NULL;
 
        CDEBUG(D_HA, "%s: started recovery thread pid %d\n", obd->obd_name,
               current_pid());