generic: test idmapped mount circular mappings
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 19 Nov 2021 19:42:09 +0000 (20:42 +0100)
committerEryu Guan <guaneryu@gmail.com>
Sun, 21 Nov 2021 15:03:30 +0000 (23:03 +0800)
commitd17a88e909568b044ada362ee19ca2d1dffc542c
treeb279c3e47e17bfdc269b8e5eb753866f35b33997
parent2d5e3202bb9389811d7fd3c6cdfa2bfd7da2a4a1
generic: test idmapped mount circular mappings

This is a regression test for the fix in [1]. The test makes sure that
setattr behaves correctly on idmapped mounts that make use of circular
mappings. Such mappings may e.g. be used to allow two users to share
home directories through the same idmapped mount. The tests are
explained in detail in code comments.

[1]: commit 968219708108 ("fs: handle circular mappings correctly")
Cc: Seth Forshee <seth.forshee@digitalocean.com>
Cc: Eryu Guan <guaneryu@gmail.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: fstests@vger.kernel.org
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
src/idmapped-mounts/idmapped-mounts.c
src/idmapped-mounts/utils.c
tests/generic/656 [new file with mode: 0755]
tests/generic/656.out [new file with mode: 0644]