Commit 3cdf0269 authored by Thomas Richter's avatar Thomas Richter Committed by Vasily Gorbik

s390/cpum_cf: log bad return code of function cfset_all_copy

When function cfset_all_copy() fails, also log the bad return code
in the debug statement (when turned on).
No functional change
Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
Acked-by: default avatarSumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 1707c116
...@@ -1290,7 +1290,7 @@ static size_t cfset_needspace(unsigned int sets) ...@@ -1290,7 +1290,7 @@ static size_t cfset_needspace(unsigned int sets)
static int cfset_all_copy(unsigned long arg, cpumask_t *mask) static int cfset_all_copy(unsigned long arg, cpumask_t *mask)
{ {
struct s390_ctrset_read __user *ctrset_read; struct s390_ctrset_read __user *ctrset_read;
unsigned int cpu, cpus, rc; unsigned int cpu, cpus, rc = 0;
void __user *uptr; void __user *uptr;
ctrset_read = (struct s390_ctrset_read __user *)arg; ctrset_read = (struct s390_ctrset_read __user *)arg;
...@@ -1304,17 +1304,20 @@ static int cfset_all_copy(unsigned long arg, cpumask_t *mask) ...@@ -1304,17 +1304,20 @@ static int cfset_all_copy(unsigned long arg, cpumask_t *mask)
rc |= put_user(cpuhw->sets, &ctrset_cpudata->no_sets); rc |= put_user(cpuhw->sets, &ctrset_cpudata->no_sets);
rc |= copy_to_user(ctrset_cpudata->data, cpuhw->data, rc |= copy_to_user(ctrset_cpudata->data, cpuhw->data,
cpuhw->used); cpuhw->used);
if (rc) if (rc) {
return -EFAULT; rc = -EFAULT;
goto out;
}
uptr += sizeof(struct s390_ctrset_cpudata) + cpuhw->used; uptr += sizeof(struct s390_ctrset_cpudata) + cpuhw->used;
cond_resched(); cond_resched();
} }
cpus = cpumask_weight(mask); cpus = cpumask_weight(mask);
if (put_user(cpus, &ctrset_read->no_cpus)) if (put_user(cpus, &ctrset_read->no_cpus))
return -EFAULT; rc = -EFAULT;
debug_sprintf_event(cf_dbg, 4, "%s copied %ld\n", __func__, out:
debug_sprintf_event(cf_dbg, 4, "%s rc %d copied %ld\n", __func__, rc,
uptr - (void __user *)ctrset_read->data); uptr - (void __user *)ctrset_read->data);
return 0; return rc;
} }
static size_t cfset_cpuset_read(struct s390_ctrset_setdata *p, int ctrset, static size_t cfset_cpuset_read(struct s390_ctrset_setdata *p, int ctrset,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment