From: Rodrigo Campos <rodrigo@sdfg.com.ar>
To: Zorro Lang <zlang@redhat.com>
Cc: fstests@vger.kernel.org, Christian Brauner <brauner@kernel.org>,
Giuseppe Scrivano <gscrivan@redhat.com>
Subject: Re: [PATCH v3 9/9] vfs: Add tmpfs tests for idmap mounts
Date: Tue, 14 Mar 2023 12:41:09 +0100 [thread overview]
Message-ID: <ec5a056d-d07c-2658-0695-2da1589f0666@sdfg.com.ar> (raw)
In-Reply-To: <20230314103905.iegn4sqhechxzqew@zlang-mailbox>
On 3/14/23 11:39, Zorro Lang wrote:
> On Mon, Mar 13, 2023 at 08:03:30PM +0100, Rodrigo Campos wrote:
>> This patch calls all tests in the suite s_idmapped_mounts, but with a
>> tmpfs directory mounted inside a userns. This directory is setup as the
>> mount point for the test that runs nested.
>>
>> This excercises that tmpfs mounted inside a userns works as expected
>> regarding idmap mounts.
>>
>> Signed-off-by: Rodrigo Campos <rodrigo@sdfg.com.ar>
>> ---
>> src/vfs/Makefile | 4 +-
>> src/vfs/tmpfs-idmapped-mounts.c | 305 ++++++++++++++++++++++++++++++++
>> src/vfs/tmpfs-idmapped-mounts.h | 15 ++
>> src/vfs/utils.h | 2 +
>> src/vfs/vfstest.c | 13 +-
>> tests/tmpfs/001 | 27 +++
>> tests/tmpfs/001.out | 2 +
>> tests/tmpfs/Makefile | 24 +++
>> 8 files changed, 389 insertions(+), 3 deletions(-)
>> create mode 100644 src/vfs/tmpfs-idmapped-mounts.c
>> create mode 100644 src/vfs/tmpfs-idmapped-mounts.h
>> create mode 100755 tests/tmpfs/001
>> create mode 100644 tests/tmpfs/001.out
>> create mode 100644 tests/tmpfs/Makefile
>>
>
> [snip]
>
>> diff --git src/vfs/tmpfs-idmapped-mounts.h src/vfs/tmpfs-idmapped-mounts.h
>> new file mode 100644
>> index 00000000..038d86a9
>> --- /dev/null
>> +++ src/vfs/tmpfs-idmapped-mounts.h
>> @@ -0,0 +1,15 @@
>> +/* SPDX-License-Identifier: GPL-2.0 */
>> +
>> +#ifndef __TMPFS_IDMAPPED_MOUNTS_H
>> +#define __TMPFS_IDMAPPED_MOUNTS_H
>> +
>> +#ifndef _GNU_SOURCE
>> +#define _GNU_SOURCE
>> +#endif
>> +
>> +#include "utils.h"
>> +
>> +extern const struct test_suite s_tmpfs_idmapped_mounts;
>> +
>> +#endif /* __TMPFS_IDMAPPED_MOUNTS_H */
>> +
> ^^
> A blank line at EOF
Removed, thanks!
>
>
>> diff --git src/vfs/utils.h src/vfs/utils.h
>> index f1681737..872fd96f 100644
>> --- src/vfs/utils.h
>> +++ src/vfs/utils.h
>> @@ -45,6 +45,8 @@
>> #define DIR2 "dir2"
>> #define DIR3 "dir3"
>
> [snip]
>
>> diff --git tests/tmpfs/Makefile tests/tmpfs/Makefile
>> new file mode 100644
>> index 00000000..b464b22b
>> --- /dev/null
>> +++ tests/tmpfs/Makefile
>> @@ -0,0 +1,24 @@
>> +#
>> +# Copyright (c) 2003-2005 Silicon Graphics, Inc. All Rights Reserved.
>
> Is the copyright what you want?
Heh, no. I'll correct it, thanks!
>
>> +#
>> +
>> +TOPDIR = ../..
>> +include $(TOPDIR)/include/builddefs
>> +include $(TOPDIR)/include/buildgrouplist
>> +
>> +GENERIC_DIR = generic
>> +TARGET_DIR = $(PKG_LIB_DIR)/$(TESTS_DIR)/$(GENERIC_DIR)
>
> Above two lines are wrong, that'll cause tmpfs/001 can't be installed correctly.
> You can change them to:
> TMPFS_DIR = tmpfs
> TARGET_DIR = $(PKG_LIB_DIR)/$(TESTS_DIR)/$(TMPFS_DIR)
Oh, I haven't tried the install. Fixed this now, tested it with a
different prefix and seems to work fine.
Best,
Rodrigo
prev parent reply other threads:[~2023-03-14 11:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-13 19:03 [PATCH v3 0/9] Tests for idmapped tmpfs Rodrigo Campos
2023-03-13 19:03 ` [PATCH v3 1/9] vfs: Don't open-code safe_close() Rodrigo Campos
2023-03-13 19:03 ` [PATCH v3 2/9] vfs: Fix documentation typo Rodrigo Campos
2023-03-13 19:03 ` [PATCH v3 3/9] vfs: Use tabs to indent, not spaces Rodrigo Campos
2023-03-13 19:03 ` [PATCH v3 4/9] vfs: Fix race condition on get_userns_fd() Rodrigo Campos
2023-03-13 19:03 ` [PATCH v3 5/9] vfs: Make switch_userns set PR_SET_DUMPABLE Rodrigo Campos
2023-03-13 19:03 ` [PATCH v3 6/9] vfs: Prepare tests in &s_idmapped_mounts to be reused inside a userns Rodrigo Campos
2023-03-13 19:03 ` [PATCH v3 7/9] vfs: Make idmapped core tests public Rodrigo Campos
2023-03-13 19:03 ` [PATCH v3 8/9] vfs: Export test_setup() and test_cleanup() Rodrigo Campos
2023-03-13 19:03 ` [PATCH v3 9/9] vfs: Add tmpfs tests for idmap mounts Rodrigo Campos
2023-03-14 10:39 ` Zorro Lang
2023-03-14 11:41 ` Rodrigo Campos [this message]
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=ec5a056d-d07c-2658-0695-2da1589f0666@sdfg.com.ar \
--to=rodrigo@sdfg.com.ar \
--cc=brauner@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=gscrivan@redhat.com \
--cc=zlang@redhat.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;
as well as URLs for NNTP newsgroup(s).