From: Jan Stancek <jstancek@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 2/2] syscalls/statx05: Fix test on ppc64le
Date: Wed, 12 Sep 2018 04:33:42 -0400 (EDT) [thread overview]
Message-ID: <831588265.47297951.1536741222106.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20180911153013.2609-2-chrubis@suse.cz>
----- Original Message -----
> Apparently the block size for ext4 filesystem has to match $PAGE_SIZE in
> order to be mounted with the crypt option.
>
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> ---
> testcases/kernel/syscalls/statx/statx05.c | 33
> +++++++++++++++++++++++--------
> 1 file changed, 25 insertions(+), 8 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/statx/statx05.c
> b/testcases/kernel/syscalls/statx/statx05.c
> index 11f1fb7bc..0a7a42f13 100644
> --- a/testcases/kernel/syscalls/statx/statx05.c
> +++ b/testcases/kernel/syscalls/statx/statx05.c
> @@ -19,14 +19,17 @@
> * Minimum kernel version required is 4.11.
> */
>
> +#include <stdlib.h>
> +#include <stdio.h>
> #include "tst_test.h"
> #include "lapi/fs.h"
> -#include <stdlib.h>
> #include "lapi/stat.h"
>
> -#define MOUNT_POINT "mnt_point"
> -#define TESTDIR_FLAGGED MOUNT_POINT"/test_dir1"
> -#define TESTDIR_UNFLAGGED MOUNT_POINT"/test_dir2"
> +#define MNTPOINT "mnt_point"
> +#define TESTDIR_FLAGGED MNTPOINT"/test_dir1"
> +#define TESTDIR_UNFLAGGED MNTPOINT"/test_dir2"
> +
> +static int mount_flag;
>
> static void test_flagged(void)
> {
> @@ -80,6 +83,15 @@ static void run(unsigned int i)
>
> static void setup(void)
> {
> + char opt_bsize[32];
> + const char *const extra_opts[] = {"-O encrypt", opt_bsize, NULL};
> +
> + snprintf(opt_bsize, sizeof(opt_bsize), "-b %i", getpagesize());
> +
> + SAFE_MKFS(tst_device->dev, tst_device->fs_type, NULL, extra_opts);
> + SAFE_MOUNT(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, 0);
> + mount_flag = 1;
> +
> SAFE_MKDIR(TESTDIR_FLAGGED, 0777);
> SAFE_MKDIR(TESTDIR_UNFLAGGED, 0777);
>
> @@ -92,15 +104,20 @@ static void setup(void)
> tst_brk(TCONF, "e4crypt failed (CONFIG_EXT4_ENCRYPTION not set?)");
> }
>
> +static void cleanup(void)
> +{
> + if (mount_flag)
> + tst_umount(MNTPOINT);
> +}
> +
> static struct tst_test test = {
> .test = run,
> .tcnt = ARRAY_SIZE(tcases),
> .setup = setup,
> + .cleanup = cleanup,
> .min_kver = "4.11",
> .needs_root = 1,
> - .mount_device = 1,
> - .mntpoint = MOUNT_POINT,
> + .needs_device = 1,
> + .mntpoint = MNTPOINT,
> .dev_fs_type = "ext4",
It's not easy to guess what role library plays, when only needs_device is
used, but you set also dev_fs_type and mntpoint. If you dropped both,
then all needed would be to MKDIR/RMDIR(mntpoint), correct?
Anyway, ACK to both patches.
Regards,
Jan
> - .dev_extra_opts = (const char *const[]){"-O encrypt", NULL},
> - .dev_min_size = 512,
> };
> --
> 2.16.4
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
>
next prev parent reply other threads:[~2018-09-12 8:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-11 15:30 [LTP] [PATCH 1/2] lib: tst_mkfs: Allow passing more extra options Cyril Hrubis
2018-09-11 15:30 ` [LTP] [PATCH 2/2] syscalls/statx05: Fix test on ppc64le Cyril Hrubis
2018-09-12 8:33 ` Jan Stancek [this message]
2018-09-12 9:52 ` Cyril Hrubis
2018-09-12 12:28 ` Cyril Hrubis
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=831588265.47297951.1536741222106.JavaMail.zimbra@redhat.com \
--to=jstancek@redhat.com \
--cc=ltp@lists.linux.it \
/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