Re: [PATCH 1/2] vfstest: move sys_umount2() to cleanup path in tcore_acls()
Zorro Lang <[email protected]> Sun, 21 Jun 2026 23:56:25 +0800
| Newsgroups | org.kernel.vger.fstests,org.kernel.vger.linux-fsdevel |
|---|---|
| Message-ID | <ajgJYwuiwxnqcJIE@zlang-mailbox> |
On Thu, Jun 18, 2026 at 12:11:53PM +0200, German Maglione wrote: > 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]> > --- Makes sense to me, thanks for fixing it. Reviewed-by: Zorro Lang <[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 >