fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/9] Tests for idmapped tmpfs
@ 2023-03-08 11:13 Rodrigo Campos
  2023-03-08 11:13 ` [PATCH v2 1/9] vfs: Don't open-code safe_close() Rodrigo Campos
                   ` (8 more replies)
  0 siblings, 9 replies; 17+ messages in thread
From: Rodrigo Campos @ 2023-03-08 11:13 UTC (permalink / raw)
  To: fstests; +Cc: Christian Brauner, Giuseppe Scrivano, Rodrigo Campos

This patches add tests for tmpfs idmap mounts inside a userns.

Changes in v2:
	* Added reviewed-by Christian to some patches
	* Clarified commit description on "Fix race condition on get_userns_fd"
	  and removed the noreturn attribute in the function
        * As noted by Christian, we can makedev(0,0) and have that work inside a
          userns. So, simplified patch 6 for that
	* Fixed typo in the #endif comment of vfstest.h
	* Folded adding DIR0 constant into the patch that uses it
	* Fixed the indentation patch to only change one line and not change the
	  usage() section

Similar as before, the first patches are just unrelated simple fixes that I saw
while playing with this:
  vfs: Don't open-code safe_close()
  vfs: Fix documentation typo
  vfs: Use tabs to indent, not spaces
  vfs: Fix race condition on get_userns_fd()

These pave the way to support running core tests within another test (from the
tmpfs suite that we will add):
  vfs: Fix race condition on get_userns_fd()
  vfs: Make switch_userns set PR_SET_DUMPABLE
  vfs: Prepare tests in &s_idmapped_mounts to be reused inside a userns
  vfs: Make idmapped core tests public
  vfs: Export test_setup() and test_cleanup()

As mentioned in the changelog, "vfs: Prepare tests in &s_idmapped_mounts to be
reused inside a userns" is now simplified. Changing only these few places to
mkdev(0, 0) did the trick. These tests are doing a switch_fsids() and that
inside the userns fails if we don't use 0:0 as major/minor.

Just to be super careful, I'd like if Christian can have a look and see if
indeed the places that mknod fails inside a userns and don't make sense.

Can you please take a look at that, Christian? I'm in a hurry and have to catch
a train in a few minutes.

Finally, the suite for idmapped tmpfs is implemented here:
  vfs: Add tmpfs tests for idmap mounts


Best,
Rodrigo

Rodrigo Campos (9):
  vfs: Don't open-code safe_close()
  vfs: Fix documentation typo
  vfs: Use tabs to indent, not spaces
  vfs: Fix race condition on get_userns_fd()
  vfs: Make switch_userns set PR_SET_DUMPABLE
  vfs: Prepare tests in &s_idmapped_mounts to be reused inside a userns
  vfs: Make idmapped core tests public
  vfs: Export test_setup() and test_cleanup()
  vfs: Add tmpfs tests for idmap mounts

 src/vfs/Makefile                |   4 +-
 src/vfs/idmapped-mounts.c       | 140 +++++++--------
 src/vfs/idmapped-mounts.h       |  38 ++++
 src/vfs/tmpfs-idmapped-mounts.c | 298 ++++++++++++++++++++++++++++++++
 src/vfs/tmpfs-idmapped-mounts.h |  15 ++
 src/vfs/utils.c                 |  19 +-
 src/vfs/utils.h                 |   4 +-
 src/vfs/vfstest.c               |  19 +-
 src/vfs/vfstest.h               |  10 ++
 tests/tmpfs/001                 |  27 +++
 tests/tmpfs/001.out             |   2 +
 tests/tmpfs/Makefile            |  24 +++
 12 files changed, 513 insertions(+), 87 deletions(-)
 create mode 100644 src/vfs/tmpfs-idmapped-mounts.c
 create mode 100644 src/vfs/tmpfs-idmapped-mounts.h
 create mode 100644 src/vfs/vfstest.h
 create mode 100755 tests/tmpfs/001
 create mode 100644 tests/tmpfs/001.out
 create mode 100644 tests/tmpfs/Makefile

-- 
2.39.2


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2023-03-13 16:21 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-08 11:13 [PATCH v2 0/9] Tests for idmapped tmpfs Rodrigo Campos
2023-03-08 11:13 ` [PATCH v2 1/9] vfs: Don't open-code safe_close() Rodrigo Campos
2023-03-08 11:13 ` [PATCH v2 2/9] vfs: Fix documentation typo Rodrigo Campos
2023-03-08 11:13 ` [PATCH v2 3/9] vfs: Use tabs to indent, not spaces Rodrigo Campos
2023-03-13 10:39   ` Christian Brauner
2023-03-08 11:13 ` [PATCH v2 4/9] vfs: Fix race condition on get_userns_fd() Rodrigo Campos
2023-03-13 10:39   ` Christian Brauner
2023-03-08 11:13 ` [PATCH v2 5/9] vfs: Make switch_userns set PR_SET_DUMPABLE Rodrigo Campos
2023-03-08 11:13 ` [PATCH v2 6/9] vfs: Prepare tests in &s_idmapped_mounts to be reused inside a userns Rodrigo Campos
2023-03-13 10:40   ` Christian Brauner
2023-03-08 11:13 ` [PATCH v2 7/9] vfs: Make idmapped core tests public Rodrigo Campos
2023-03-08 11:13 ` [PATCH v2 8/9] vfs: Export test_setup() and test_cleanup() Rodrigo Campos
2023-03-13 10:41   ` Christian Brauner
2023-03-08 11:13 ` [PATCH v2 9/9] vfs: Add tmpfs tests for idmap mounts Rodrigo Campos
2023-03-13 10:50   ` Christian Brauner
2023-03-13 14:26     ` Zorro Lang
2023-03-13 16:21     ` Rodrigo Campos

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).