Whamcloud - gitweb
LU-5654 osp: Call obd_fid_fini() on osp_init0() error path
[fs/lustre-release.git] / lustre / ptlrpc / nrs_tbf.c
index 50ddbf4..6c7b5dc 100644 (file)
@@ -38,9 +38,6 @@
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
-#ifndef __KERNEL__
-#include <liblustre.h>
-#endif
 #include <obd_support.h>
 #include <obd_class.h>
 #include <libcfs/libcfs.h>
@@ -629,7 +626,7 @@ nrs_tbf_jobid_cli_init(struct nrs_tbf_client *cli,
 
        if (jobid == NULL)
                jobid = NRS_TBF_JOBID_NULL;
-       LASSERT(strlen(jobid) < JOBSTATS_JOBID_SIZE);
+       LASSERT(strlen(jobid) < LUSTRE_JOBID_SIZE);
        INIT_LIST_HEAD(&cli->tc_lru);
        memcpy(cli->tc_jobid, jobid, strlen(jobid));
 }
@@ -1579,6 +1576,14 @@ ptlrpc_lprocfs_nrs_tbf_rule_seq_show(struct seq_file *m, void *data)
                                       false, m);
        if (rc == 0) {
                /**
+                * -ENOSPC means buf in the parameter m is overflow, return 0
+                * here to let upper layer function seq_read alloc a larger
+                * memory area and do this process again.
+                */
+       } else if (rc == -ENOSPC) {
+               return 0;
+
+               /**
                 * Ignore -ENODEV as the regular NRS head's policy may be in the
                 * ptlrpc_nrs_pol_state::NRS_POL_STATE_STOPPED state.
                 */
@@ -1596,11 +1601,12 @@ ptlrpc_lprocfs_nrs_tbf_rule_seq_show(struct seq_file *m, void *data)
                                       false, m);
        if (rc == 0) {
                /**
-                * Ignore -ENODEV as the high priority NRS head's policy may be
-                * in the ptlrpc_nrs_pol_state::NRS_POL_STATE_STOPPED state.
+                * -ENOSPC means buf in the parameter m is overflow, return 0
+                * here to let upper layer function seq_read alloc a larger
+                * memory area and do this process again.
                 */
-       } else if (rc != -ENODEV) {
-               return rc;
+       } else if (rc == -ENOSPC) {
+               return 0;
        }
 
 no_hp: