A few more quota+private reservations special-cases slipped through the cracks
(probably due to a kernel bug that existed until 2.6.27-rc1).
When doing the COW tests, a kernel supporting private reservations will also
check the FS quota before allowing the COW mapping to be created. Therefore,
these test cases will get a mmap failure rather than a SIGKILL like they used
to without private reservations. Yay for increased kernel reliability!
Since there are now more cases that depend on checking for private reservation
support, and having this support always turns a BAD_SIG into a BAD_EXIT, we can
do a little cleanup in the main function.
Signed-off-by: Adam Litke <[EMAIL PROTECTED]>
---
tests/quota.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/tests/quota.c b/tests/quota.c
index 5ad71fd..5a62d82 100644
--- a/tests/quota.c
+++ b/tests/quota.c
@@ -197,6 +197,7 @@ int main(int argc, char ** argv)
check_must_be_root();
mountpoint[0] = '\0';
hpage_size = check_hugepagesize();
+ int bad_priv_resv;
check_free_huge_pages(1);
get_quota_fs(hpage_size);
@@ -205,6 +206,7 @@ int main(int argc, char ** argv)
if ((private_resv = kernel_has_private_reservations(fd)) == -1)
FAIL("kernel_has_private_reservations() failed\n");
close(fd);
+ bad_priv_resv = private_resv ? BAD_EXIT : BAD_SIG;
/*
* Check that unused quota is cleared when untouched mmaps are
@@ -232,16 +234,13 @@ int main(int argc, char ** argv)
* If private mappings are reserved, the quota is checked up front
* (as is the case for shared mappings).
*/
- if (private_resv)
- spawn(BAD_EXIT, 2 * hpage_size, MAP_PRIVATE, ACTION_TOUCH);
- else
- spawn(BAD_SIG, 2 * hpage_size, MAP_PRIVATE, ACTION_TOUCH);
+ spawn(bad_priv_resv, 2 * hpage_size, MAP_PRIVATE, ACTION_TOUCH);
/*
* COW should not be allowed if doing so puts the fs over quota.
*/
- spawn(BAD_SIG, hpage_size, MAP_SHARED, ACTION_TOUCH|ACTION_COW);
- spawn(BAD_SIG, hpage_size, MAP_PRIVATE, ACTION_TOUCH|ACTION_COW);
+ spawn(bad_priv_resv, hpage_size, MAP_SHARED, ACTION_TOUCH|ACTION_COW);
+ spawn(bad_priv_resv, hpage_size, MAP_PRIVATE, ACTION_TOUCH|ACTION_COW);
/*
* Make sure that operations within the quota will succeed after
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Libhugetlbfs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel