Since 'demote' is a write-only file do not attempt to
to read it. This also prevents the plugin from generating
incessant logs about the failure to open it.
Fixes: #3993
https://docs.kernel.org/admin-guide/mm/hugetlbpage.html
struct entry_info *info = e_info;
double value;
+ /**
+ * Since demote is a write-only file, do not attempt to open it.
+ * https://docs.kernel.org/admin-guide/mm/hugetlbpage.html
+ */
+ if (strcmp(entry, "demote") == 0) {
+ return -1;
+ }
+
snprintf(path2, sizeof(path2), "%s/%s", path, entry);
FILE *fh = fopen(path2, "rt");