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 <[email protected]>
---
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
On Thu, Feb 25, 2021 at 03:12:10PM -0800, Hugh Dickins wrote:
> 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.
Totally agree!
>
> Signed-off-by: Hugh Dickins <[email protected]>
Acked-by: Roman Gushchin <[email protected]>
> ---
>
> 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