Description: disk plugin: Support Linux kernels with additional fields.
 Linux 4.19 will add additional counters, which caused this plugin to
 bail out because it checked the number of fields exactly instead of
 ensuring that there are *at least* the number of fields expected.

 Fixes: #2951
Author: 
Origin: upstream, https://github.com/collectd/collectd/commit/6ce52f70cc1e6450df3454f19743a29295b84050
Bug: https://github.com/collectd/collectd/issues/2951
Bug-Ubuntu: https://launchpad.net/bugs/1865895
--- a/src/disk.c
+++ b/src/disk.c
@@ -695,7 +695,9 @@
 
     numfields = strsplit(buffer, fields, 32);
 
-    if ((numfields != (14 + fieldshift)) && (numfields != 7))
+    /* need either 7 fields (partition)
+     * or at least 14 fields (15 on Linux 2.4) */
+    if ((numfields != 7) && (numfields < (14 + fieldshift)))
       continue;
 
     minor = atoll(fields[1]);
@@ -729,7 +731,8 @@
       read_sectors = atoll(fields[4]);
       write_ops = atoll(fields[5]);
       write_sectors = atoll(fields[6]);
-    } else if (numfields == (14 + fieldshift)) {
+    } else {
+      assert(numfields >= (14 + fieldshift));
       read_ops = atoll(fields[3 + fieldshift]);
       write_ops = atoll(fields[7 + fieldshift]);
 
@@ -748,9 +751,6 @@
         io_time = atof(fields[12 + fieldshift]);
         weighted_time = atof(fields[13 + fieldshift]);
       }
-    } else {
-      DEBUG("numfields = %i; => unknown file format.", numfields);
-      continue;
     }
 
     {
