[PATCH 2/4] mm: no more EINVAL from /proc/sys/vm/stat_refresh

From: Hugh Dickins
Date: Thu Feb 25 2021 - 18:12:59 EST


EINVAL was good for drawing the refresher's attention to a warning in
dmesg, but became very tiresome when running test suites scripted with
"set -e": an underflow from a bug in one feature would cause unrelated
tests much later to fail, just because their /proc/sys/vm/stat_refresh
touch failed with that error. Stop doing that.

Signed-off-by: Hugh Dickins <hughd@xxxxxxxxxx>
---

mm/vmstat.c | 5 -----
1 file changed, 5 deletions(-)

--- vmstat1/mm/vmstat.c 2021-02-25 11:50:36.000000000 -0800
+++ vmstat2/mm/vmstat.c 2021-02-25 11:56:18.000000000 -0800
@@ -1844,7 +1844,6 @@ int vmstat_refresh(struct ctl_table *tab
if (val < 0) {
pr_warn("%s: %s %ld\n",
__func__, zone_stat_name(i), val);
- err = -EINVAL;
}
}
#ifdef CONFIG_NUMA
@@ -1853,7 +1852,6 @@ int vmstat_refresh(struct ctl_table *tab
if (val < 0) {
pr_warn("%s: %s %ld\n",
__func__, numa_stat_name(i), val);
- err = -EINVAL;
}
}
#endif
@@ -1862,11 +1860,8 @@ int vmstat_refresh(struct ctl_table *tab
if (val < 0) {
pr_warn("%s: %s %ld\n",
__func__, node_stat_name(i), val);
- err = -EINVAL;
}
}
- if (err)
- return err;
if (write)
*ppos += *lenp;
else