Whamcloud - gitweb
LU-14930 mdt: abort_recov_mdt shouldn't abort client recovery
[fs/lustre-release.git] / lustre / obdclass / lprocfs_status_server.c
index a8602c7..8584b1b 100644 (file)
@@ -27,7 +27,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/obdclass/lprocfs_status_server.c
  */
@@ -124,7 +123,8 @@ lprocfs_evict_client_seq_write(struct file *file, const char __user *buffer,
                count = -EFAULT;
                goto out;
        }
-       tmpbuf = cfs_firststr(kbuf, min_t(unsigned long, BUFLEN - 1, count));
+       tmpbuf = skip_spaces(kbuf);
+       tmpbuf = strsep(&tmpbuf, " \t\n\f\v\r");
        class_incref(obd, __func__, current);
 
        if (strncmp(tmpbuf, "nid:", 4) == 0)
@@ -195,6 +195,19 @@ lprocfs_exp_print_export_seq(struct obd_export *exp, void *cb_data)
        obd_export_flags2str(exp, m);
        seq_printf(m, " ]\n");
 
+       if (obd->obd_type &&
+           strcmp(obd->obd_type->typ_name, "obdfilter") == 0) {
+               struct filter_export_data *fed = &exp->exp_filter_data;
+
+               seq_printf(m, "    grant:\n");
+               seq_printf(m, "       granted: %ld\n",
+                       fed->fed_ted.ted_grant);
+               seq_printf(m, "       dirty: %ld\n",
+                       fed->fed_ted.ted_dirty);
+               seq_printf(m, "       pending: %ld\n",
+                       fed->fed_ted.ted_pending);
+       }
+
 out:
        return 0;
 }
@@ -689,8 +702,11 @@ int lprocfs_recovery_status_seq_show(struct seq_file *m, void *data)
                goto out;
        }
 
-       /* sampled unlocked, but really... */
-       if (obd->obd_recovering == 0) {
+       /* There is gap between client data read from storage and setting
+        * obd_recovering so check obd_recovery_end as well to make sure
+        * recovery is really finished
+        */
+       if (obd->obd_recovery_end > 0 && !obd->obd_recovering) {
                seq_printf(m, "COMPLETE\n");
                seq_printf(m, "recovery_start: %lld\n",
                           (s64)ktime_get_real_seconds() -