One change in do_mbind() of this commit has suspicious usage of return value of
queue_pages_range(), excerpt as below:
---
@@ -1243,10 +1265,15 @@ static long do_mbind(unsigned long start, unsigned long len,
 if (err)
 goto mpol_out;
- err = queue_pages_range(mm, start, end, nmask,
+ ret = queue_pages_range(mm, start, end, nmask,
 Âflags | MPOL_MF_INVERT, &pagelist);
- if (!err)
- err = mbind_range(mm, start, end, new);
+
+ if (ret < 0) { Â Â Â/////// convert to all possible 'ret' to '-EIO' <<<<
+ err = -EIO;
+ goto up_out;
+ }
+
+ err = mbind_range(mm, start, end, new);
 if (!err) {
 int nr_failed = 0;
---
Note that insideÂqueue_pages_range(), the call toÂwalk_page_range() may return
errors from 'test_walk' of 'struct mm_walk_ops', e.g. -EFAULT. Now, those error
codes are no longer reported to user space application.
From user space, the mbind() call need to reported error, with EFAULT, as example:
EFAULT
Part or all of the memory range specified by nodemask and maxnode points
outside your accessible address space. Or, there was an unmapped hole in the
specified memory range specified by addr and len.
Please correct me if this is the intended change(and will have updated API
definition), or something was misunderstood.
-Xinhai