[PATCH 1/2] vfstest: move sys_umount2() to cleanup path in tcore_acls()
German Maglione <[email protected]> Thu, 18 Jun 2026 12:11:53 +0200
| Newsgroups | org.kernel.vger.fstests,org.kernel.vger.linux-fsdevel |
|---|---|
| Message-ID | <[email protected]> |
sys_umount2() in tcore_acls() only runs on the success path. If setfacl fails (e.g. no ACL support), the mount on DIR2 is left behind and test_cleanup() can't remove T_DIR1. This causes every subsequent test to fail with EEXIST on mkdirat(T_DIR1). Move sys_umount2() into the out: block so it always runs. Signed-off-by: German Maglione <[email protected]> --- src/vfs/idmapped-mounts.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/vfs/idmapped-mounts.c b/src/vfs/idmapped-mounts.c index ed9992f975c14b57c5d6d1634ca011b015b78bcb..d0630f5931ade713a99f5dec1cbe24bdaa75d35d 100644 --- a/src/vfs/idmapped-mounts.c +++ b/src/vfs/idmapped-mounts.c @@ -240,12 +240,11 @@ int tcore_acls(const struct vfstest_info *info) goto out; } - snprintf(t_buf, sizeof(t_buf), "%s/" T_DIR1 "/" DIR2, info->t_mountpoint); - sys_umount2(t_buf, MNT_DETACH); - fret = 0; log_debug("Ran test"); out: + snprintf(t_buf, sizeof(t_buf), "%s/" T_DIR1 "/" DIR2, info->t_mountpoint); + sys_umount2(t_buf, MNT_DETACH); safe_close(attr.userns_fd); safe_close(dir1_fd); safe_close(open_tree_fd); -- 2.49.0