From: ebiederm@xmission.com (Eric W. Biederman)
To: Shuah Khan <shuahkh@osg.samsung.com>
Cc: akpm@linux-foundation.org, gregkh@linuxfoundation.org,
colin.king@canonical.com, dbueso@suse.de,
serge.hallyn@ubuntu.com, thierry@linux.vnet.ibm.com,
luto@amacapital.net, linux-api@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 5/7] selftests/mount: change test to use ksft framework
Date: Tue, 23 Sep 2014 15:41:20 -0700 [thread overview]
Message-ID: <87d2am2c4v.fsf@x220.int.ebiederm.org> (raw)
In-Reply-To: <969f0780734a04763f2b54063603b93380244d0c.1411506121.git.shuahkh@osg.samsung.com> (Shuah Khan's message of "Tue, 23 Sep 2014 15:32:58 -0600")
Shuah Khan <shuahkh@osg.samsung.com> writes:
> Change mount test to use kselftest framework to report
> test results.
Nacked-by: "Eric W. Biederman" <ebiederm@xmission.com>
I am curious did you even run these tests? I can't possibly see how
the tests would have passed with this change. At the very least you
have taken this test from linear to exponential time complexity.
> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
> ---
> tools/testing/selftests/mount/unprivileged-remount-test.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/tools/testing/selftests/mount/unprivileged-remount-test.c b/tools/testing/selftests/mount/unprivileged-remount-test.c
> index 1b3ff2f..c64d442 100644
> --- a/tools/testing/selftests/mount/unprivileged-remount-test.c
> +++ b/tools/testing/selftests/mount/unprivileged-remount-test.c
> @@ -13,6 +13,8 @@
> #include <stdbool.h>
> #include <stdarg.h>
>
> +#include "../kselftest.h"
> +
> #ifndef CLONE_NEWNS
> # define CLONE_NEWNS 0x00020000
> #endif
> @@ -45,7 +47,7 @@ static void die(char *fmt, ...)
> va_start(ap, fmt);
> vfprintf(stderr, fmt, ap);
> va_end(ap);
> - exit(EXIT_FAILURE);
> + ksft_exit_fail();
> }
>
> static void write_file(char *filename, char *fmt, ...)
> @@ -176,7 +178,7 @@ bool test_unpriv_remount(int mount_flags, int remount_flags, int invalid_flags)
> die("remount of /tmp with invalid flags "
> "succeeded unexpectedly\n");
> }
> - exit(EXIT_SUCCESS);
> + return ksft_exit_pass();
This change is a deep bug.
This exit is a forked child process (not from the test itself). That a
few lines earlier in the test I test the value of in waitpid.
Also in your change commit comment if no where else you should have
called out that you were making a semantic change to the test.
> }
>
> static bool test_unpriv_remount_simple(int mount_flags)
> @@ -238,5 +240,5 @@ int main(int argc, char **argv)
> {
> die("Default atime malfunctions\n");
> }
> - return EXIT_SUCCESS;
> + return ksft_exit_pass();
> }
next prev parent reply other threads:[~2014-09-23 22:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-23 21:32 [PATCH v2 0/7] kselftest framework and test changes to use it Shuah Khan
2014-09-23 21:32 ` [PATCH v2 1/7] selftests: add kselftest framework for uniform test reporting Shuah Khan
2014-09-24 8:09 ` Davidlohr Bueso
2014-09-24 22:06 ` Shuah Khan
2014-09-23 21:32 ` [PATCH v2 2/7] selftests/breakpoints: change test to use ksft framework Shuah Khan
2014-09-23 21:32 ` [PATCH v2 3/7] selftests/ipc: " Shuah Khan
2014-09-23 21:32 ` [PATCH v2 4/7] selftests/kcmp: " Shuah Khan
2014-09-23 21:32 ` [PATCH v2 5/7] selftests/mount: " Shuah Khan
2014-09-23 22:41 ` Eric W. Biederman [this message]
2014-09-23 22:56 ` Shuah Khan
2014-09-23 23:07 ` Eric W. Biederman
2014-09-23 23:18 ` Shuah Khan
2014-09-23 21:32 ` [PATCH v2 6/7] selftests/ptrace: " Shuah Khan
2014-09-23 21:33 ` [PATCH v2 7/7] selftests/timers: " Shuah Khan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d2am2c4v.fsf@x220.int.ebiederm.org \
--to=ebiederm@xmission.com \
--cc=akpm@linux-foundation.org \
--cc=colin.king@canonical.com \
--cc=dbueso@suse.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=serge.hallyn@ubuntu.com \
--cc=shuahkh@osg.samsung.com \
--cc=thierry@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox