Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp358816rdb; Thu, 22 Feb 2024 06:07:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWcoPKlIiqmYPBf84dN0C2vXccaqc5AONRwt7r3mJtUyKglqu4RohR10fK0qWdiU2tt5lBFuNGuc5o77fYa+D0leI3X4248MR21JYavvA== X-Google-Smtp-Source: AGHT+IEHL7KUsmwR78Z3MrTwb3q2XYzRnbOcibDInCDHk+CfA/6l7KwYERFcUIOwcG+7UnuUB4Ql X-Received: by 2002:a6b:c8d8:0:b0:7c7:8b50:fedf with SMTP id y207-20020a6bc8d8000000b007c78b50fedfmr668752iof.4.1708610862974; Thu, 22 Feb 2024 06:07:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708610862; cv=pass; d=google.com; s=arc-20160816; b=OSpa9QFp+ykqOsBFcvcKWXJytfDL9CKOorQFCWW7852OCVym3/4TaPs9ZGIyontrpf S/w95GKPqA3+aH+xgBsYfx9ZGxDE1OS6/kG9Gfa6qTTfoWwW/0PNriVkP6I+1cnUvpGF AP/RzZJAOk+X90nN4++INEGuyksae7tcqbZEfxI//HVhchikNblygQDA9Nss/xpmQsN+ BoyKmmcMUNeMajRf0A+B7oFTJs3KVMPP20AOh1MyHsYhUO7+5mh0TGjpJLpQB/QO+8EE 2R42oKmEQoaKHCrmDZ2gDsgSjTI2QZBr0MOFejynoc6LjSKGPR1oE8LQ8gGGcnPa1SlW nYWQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature:dkim-signature :dkim-signature:dkim-signature; bh=acdZ8LVcWSMGBTMewHHNBiVmcYPLb6CWq9Vzh/DADVw=; fh=1Ps6owBUg0cxMQvPU0BHzphUA37o6VYe9j+8z2TeOX4=; b=AFWBSxM2Kplbrlwb6E9Oki+BQPoWlxXgK+Z89hsCzAYGTP+eBlQ7sh9x40YEsTbefI UyOd4LJxtZFUS1LYkIUvRKKg3NhVGr0enJBH4io+u3VQDwa19zJv7Pj1lRBeKAQtg3td FX4821a1mQATKQc9zq5QpgudA8EavNejemhLEbNuXLsckwZb9u8Y8ZvRLfjGPUImEq67 n/p5aMMVqRBzQUNqpvQRukv/IKi7lxYHFeMmCfIagoOpr+svasRyrjKA0fKCLqGdU6LM VeLQ7FkhoefKWzSH+ry4eotxB7MPdvUprcntpx40Ci2vUgHiNujXzFt9ehoiR3qUl7zc WqIg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=dpz0jo4m; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=dpz0jo4m; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-ext4+bounces-1361-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1361-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id l18-20020a056638145200b00474122ede0fsi4183937jad.78.2024.02.22.06.07.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 06:07:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-1361-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=dpz0jo4m; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=dpz0jo4m; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-ext4+bounces-1361-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1361-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 890BC28804D for ; Thu, 22 Feb 2024 14:07:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1C46E1474DA; Thu, 22 Feb 2024 14:05:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="dpz0jo4m"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="v7TLU91I"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="dpz0jo4m"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="v7TLU91I" X-Original-To: linux-ext4@vger.kernel.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 85C7A137C29; Thu, 22 Feb 2024 14:05:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708610727; cv=none; b=FmoMp+RMPOYLD9cmiZRl816ULxadJZo1nzSnO4GWW4Sjn77LVaqSgvLq7ARA033LKqaVbdC6eRgadN7/6+73ncn28ZjamDbGQAocuu/dqn7vn2XV9Y9O+emBNZOHvNc+ftq3Py32Z7wWJguhHL53rjc0dVKdAvP/nlRJ9Q+f7DU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708610727; c=relaxed/simple; bh=d0+tCb/QtYVyzE5lfltiNEbxt0MX4U/rUWnBvxPJxl8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=o99DYwCJSi8ZXHDKqqWV+H4ghXMAi+ei+A8NrccJRL1bhAhgLu2251g9SbhYkD+kAUKq0M3oqQxFbXCq/OkQuSmI/PDRULWyRghTu4/DjMZgdtVaWla8uCKojGDYgnRzb/vRYgQglZMuisrJR1hNbbt1zQ3PtAFn6H+U8uVTxpk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=dpz0jo4m; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=v7TLU91I; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=dpz0jo4m; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=v7TLU91I; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 20AA72116C; Thu, 22 Feb 2024 14:05:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708610722; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=acdZ8LVcWSMGBTMewHHNBiVmcYPLb6CWq9Vzh/DADVw=; b=dpz0jo4m6arGGFDkpaaJtRpHLZiHOCB8cpKKJYP6fbrj0YJhxilLJQnwNQMCBsD5R5uWUZ y6DXrk3bCNvygk3da6ozEFEMxMklzcYn+Ba77jR9VbCjhRhjyJFZaoFWshmfneeF3kLjBy bcOw6LBuNIOJLG9WlqcNvGqGhkjcBRc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708610722; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=acdZ8LVcWSMGBTMewHHNBiVmcYPLb6CWq9Vzh/DADVw=; b=v7TLU91IGUxYqVbsoh+/QlAHpNC8K3YAQLx/StHp6HU1h8cwZ5WGBY4KJWgyl1Ajjg/kbQ IguoC1hiHtRJcUBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708610722; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=acdZ8LVcWSMGBTMewHHNBiVmcYPLb6CWq9Vzh/DADVw=; b=dpz0jo4m6arGGFDkpaaJtRpHLZiHOCB8cpKKJYP6fbrj0YJhxilLJQnwNQMCBsD5R5uWUZ y6DXrk3bCNvygk3da6ozEFEMxMklzcYn+Ba77jR9VbCjhRhjyJFZaoFWshmfneeF3kLjBy bcOw6LBuNIOJLG9WlqcNvGqGhkjcBRc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708610722; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=acdZ8LVcWSMGBTMewHHNBiVmcYPLb6CWq9Vzh/DADVw=; b=v7TLU91IGUxYqVbsoh+/QlAHpNC8K3YAQLx/StHp6HU1h8cwZ5WGBY4KJWgyl1Ajjg/kbQ IguoC1hiHtRJcUBQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id BB4CE133DC; Thu, 22 Feb 2024 14:05:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 995fKqFU12VzQwAAD6G6ig (envelope-from ); Thu, 22 Feb 2024 14:05:21 +0000 Received: from localhost (brahms.olymp [local]) by brahms.olymp (OpenSMTPD) with ESMTPA id 225b0458; Thu, 22 Feb 2024 14:05:20 +0000 (UTC) From: Luis Henriques To: Christian Brauner Cc: Zorro Lang , linux-ext4@vger.kernel.org, fstests@vger.kernel.org Subject: Re: [PATCH] vfs: fix check for tmpfile support In-Reply-To: <20240222-mango-batterie-505564cecb69@brauner> (Christian Brauner's message of "Thu, 22 Feb 2024 14:23:06 +0100") References: <87jzmxisqm.fsf@suse.de> <20240222-mango-batterie-505564cecb69@brauner> Date: Thu, 22 Feb 2024 14:05:20 +0000 Message-ID: <87cysoh9wf.fsf@suse.de> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Level: Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=dpz0jo4m; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=v7TLU91I X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-3.51 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; DWL_DNSWL_MED(-2.00)[suse.de:dkim]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCVD_COUNT_THREE(0.00)[4]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Score: -3.51 X-Rspamd-Queue-Id: 20AA72116C X-Spam-Flag: NO Christian Brauner writes: > When ext4 is used with quota support the test fails with EINVAL because > it is run after we idmapped the mount. If the caller's fs{g,u}ids aren't > mapped then we fail and log a misleading error. Move the checks for > tmpfile support right at the beginning of the test in all tests. > > Reported-by: Luis Henriques > Link: https://lore.kernel.org/r/20240222-knast-reifen-953312ce17a9@brauner > Signed-off-by: Christian Brauner FWIW I've just tested this patch and I can confirm it fixes the failures I was seeing in ext4. Again, thanks a lot, Christian. Cheers, --=20 Lu=C3=ADs > --- > src/vfs/idmapped-mounts.c | 24 ++++++++++++------------ > 1 file changed, 12 insertions(+), 12 deletions(-) > > diff --git a/src/vfs/idmapped-mounts.c b/src/vfs/idmapped-mounts.c > index 547182fe..e490f3d7 100644 > --- a/src/vfs/idmapped-mounts.c > +++ b/src/vfs/idmapped-mounts.c > @@ -3815,6 +3815,8 @@ int tcore_setgid_create_idmapped(const struct vfste= st_info *info) > goto out; > } >=20=20 > + supported =3D openat_tmpfile_supported(info->t_dir1_fd); > + > /* Changing mount properties on a detached mount. */ > attr.userns_fd =3D get_userns_fd(0, 10000, 10000); > if (attr.userns_fd < 0) { > @@ -3838,8 +3840,6 @@ int tcore_setgid_create_idmapped(const struct vfste= st_info *info) > goto out; > } >=20=20 > - supported =3D openat_tmpfile_supported(open_tree_fd); > - > pid =3D fork(); > if (pid < 0) { > log_stderr("failure: fork"); > @@ -3991,6 +3991,8 @@ int tcore_setgid_create_idmapped_in_userns(const st= ruct vfstest_info *info) > goto out; > } >=20=20 > + supported =3D openat_tmpfile_supported(info->t_dir1_fd); > + > /* Changing mount properties on a detached mount. */ > attr.userns_fd =3D get_userns_fd(0, 10000, 10000); > if (attr.userns_fd < 0) { > @@ -4014,8 +4016,6 @@ int tcore_setgid_create_idmapped_in_userns(const st= ruct vfstest_info *info) > goto out; > } >=20=20 > - supported =3D openat_tmpfile_supported(open_tree_fd); > - > pid =3D fork(); > if (pid < 0) { > log_stderr("failure: fork"); > @@ -7715,6 +7715,8 @@ static int setgid_create_umask_idmapped(const struc= t vfstest_info *info) > goto out; > } >=20=20 > + supported =3D openat_tmpfile_supported(info->t_dir1_fd); > + > /* Changing mount properties on a detached mount. */ > attr.userns_fd =3D get_userns_fd(0, 10000, 10000); > if (attr.userns_fd < 0) { > @@ -7738,8 +7740,6 @@ static int setgid_create_umask_idmapped(const struc= t vfstest_info *info) > goto out; > } >=20=20 > - supported =3D openat_tmpfile_supported(open_tree_fd); > - > pid =3D fork(); > if (pid < 0) { > log_stderr("failure: fork"); > @@ -7929,6 +7929,8 @@ static int setgid_create_umask_idmapped_in_userns(c= onst struct vfstest_info *inf > goto out; > } >=20=20 > + supported =3D openat_tmpfile_supported(info->t_dir1_fd); > + > /* Changing mount properties on a detached mount. */ > attr.userns_fd =3D get_userns_fd(0, 10000, 10000); > if (attr.userns_fd < 0) { > @@ -7952,8 +7954,6 @@ static int setgid_create_umask_idmapped_in_userns(c= onst struct vfstest_info *inf > goto out; > } >=20=20 > - supported =3D openat_tmpfile_supported(open_tree_fd); > - > /* > * Below we verify that setgid inheritance for a newly created file or > * directory works correctly. As part of this we need to verify that > @@ -8163,6 +8163,8 @@ static int setgid_create_acl_idmapped(const struct = vfstest_info *info) > goto out; > } >=20=20 > + supported =3D openat_tmpfile_supported(info->t_dir1_fd); > + > /* Changing mount properties on a detached mount. */ > attr.userns_fd =3D get_userns_fd(0, 10000, 10000); > if (attr.userns_fd < 0) { > @@ -8186,8 +8188,6 @@ static int setgid_create_acl_idmapped(const struct = vfstest_info *info) > goto out; > } >=20=20 > - supported =3D openat_tmpfile_supported(open_tree_fd); > - > pid =3D fork(); > if (pid < 0) { > log_stderr("failure: fork"); > @@ -8518,6 +8518,8 @@ static int setgid_create_acl_idmapped_in_userns(con= st struct vfstest_info *info) > goto out; > } >=20=20 > + supported =3D openat_tmpfile_supported(info->t_dir1_fd); > + > /* Changing mount properties on a detached mount. */ > attr.userns_fd =3D get_userns_fd(0, 10000, 10000); > if (attr.userns_fd < 0) { > @@ -8541,8 +8543,6 @@ static int setgid_create_acl_idmapped_in_userns(con= st struct vfstest_info *info) > goto out; > } >=20=20 > - supported =3D openat_tmpfile_supported(open_tree_fd); > - > /* > * Below we verify that setgid inheritance for a newly created file or > * directory works correctly. As part of this we need to verify that > --=20 > > 2.43.0 >