On Wed, Apr 12, 2023 at 09:08:11AM -0700, Stefan Roesch wrote:
Matthew Wilcox willy@infradead.org writes:
On Tue, Apr 11, 2023 at 08:16:46PM -0700, Stefan Roesch wrote:
case PR_SET_VMA: error = prctl_set_vma(arg2, arg3, arg4, arg5); break; +#ifdef CONFIG_KSM
- case PR_SET_MEMORY_MERGE:
if (mmap_write_lock_killable(me->mm))
return -EINTR;
if (arg2) {
int err = ksm_add_mm(me->mm);
if (!err)
ksm_add_vmas(me->mm);
in the last version of this patch, you reported the error. Now you swallow the error. I have no idea which is correct, but you've changed the behaviour without explaining it, so I assume it's wrong.
I don't see how the error is swallowed in the arg2 case. If there is an error ksm_add_vmas is not executedd and at the end of the function the error is returned. Am I missing something?
You said 'int err' which declares a new variable. If you want it reported, just use 'error = ksm_add_mm(me->mm);'.