Whamcloud - gitweb
LU-5379 ptlprc: return 0 if buf in struct seq_file is overflow
[fs/lustre-release.git] / lustre / ptlrpc / nrs_tbf.c
index 50ddbf4..63c7b38 100644 (file)
@@ -1579,6 +1579,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 +1604,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: