mbox series

[v3,0/9] Tests for idmapped tmpfs

Message ID 20230313190330.94229-1-rodrigo@sdfg.com.ar (mailing list archive)
Headers show
Series Tests for idmapped tmpfs | expand


Rodrigo Campos March 13, 2023, 7:03 p.m. UTC

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

Changes in v3:
	* In patch 9, changed the name of labels for goto. Now after we created
	  an fd, on error we "goto close", after a mkdir, we "goto rm", and so.
	  Before the labels were based on what operation we skipped, that was
	  not so clear when adding a "goto" to which label we should error out.
	* Added Reviewed-by Christian to the first 8 patches
	* Addressed all comments by Christian regarding patch 9, listed below:
	* Removed old reference in the commit msg to
	  "t_inside_userns", as that is not used anymore
	* Make the mount private
	* Use C89 declaration style (declare varaibles at the top of the
	* Use "if (!x)" instead of "if (x == NULL)" for not asigned char* vars
	* Add missing space in an if

The only patch changed is the last one (module adding Reviewed-by tags).

I've kept the tabs vs space tabs just in case, but Zorro please feel free to
drop it (IIUC you prefer that?).

Thanks againg for your reviews!


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 | 305 ++++++++++++++++++++++++++++++++
 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, 520 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