Skip to content

Commit

Permalink
move_pages04: remove special-casing for kernels < 4.3
Browse files Browse the repository at this point in the history
Let's stop pretending that kernels < 4.3 did the right thing: they
didn't. Let the test fail if we run on these kernels.

Suggested-by: Jan Stancek <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
Reviewed-by: Jan Stancek <[email protected]>
Reviewed-by: Cyril Hrubis <[email protected]>
  • Loading branch information
davidhildenbrand authored and metan-ucw committed Oct 17, 2024
1 parent e0dfe8e commit 57ab216
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions testcases/kernel/syscalls/move_pages/move_pages04.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
* -ENOENT. Note that kernels >= 4.3 [1] and < 6.12 [2] wrongly returned
* -EFAULT by accident.
* 3. Check if the corresponding status for "shared zero page" is set to:
* -ENOENT for kernels < 4.3
* -EFAULT for kernels >= 4.3 [1]
* -EFAULT. Note that kernels < 4.3 [1] wrongly returned -ENOENT.
* 4. Check if the corresponding status for "invalid memory area" is set
* to -EFAULT.
*
Expand Down Expand Up @@ -102,12 +101,7 @@ int main(int argc, char **argv)
int lc;
unsigned int from_node;
unsigned int to_node;
int ret, exp_zero_page_status;

if ((tst_kvercmp(4, 3, 0)) >= 0)
exp_zero_page_status = -EFAULT;
else
exp_zero_page_status = -ENOENT;
int ret;

ret = get_allowed_nodes(NH_MEMS, 2, &from_node, &to_node);
if (ret < 0)
Expand Down Expand Up @@ -189,14 +183,14 @@ int main(int argc, char **argv)
tst_strerrno(ENOENT));
}

if (status[ZERO_PAGE] == exp_zero_page_status) {
if (status[ZERO_PAGE] == -EFAULT) {
tst_resm(TPASS, "status[%d] has expected value",
ZERO_PAGE);
} else {
tst_resm(TFAIL, "status[%d] is %s, expected %s",
ZERO_PAGE,
tst_strerrno(-status[ZERO_PAGE]),
tst_strerrno(-exp_zero_page_status));
tst_strerrno(EFAULT));
}

if (status[INVALID_PAGE] == -EFAULT) {
Expand Down

0 comments on commit 57ab216

Please sign in to comment.