From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Weimer Subject: Re: [PATCH v3 5/5] selftests: add fchmodat4(2) selftest Date: Tue, 11 Jul 2023 14:10:58 +0200 Message-ID: <87pm4ybqct.fsf@oldenburg.str.redhat.com> References: <87o8pscpny.fsf@oldenburg2.str.redhat.com> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689077475; h=from:from:reply-to:subject:subject: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=jciyvh7bPAJKrnb358k+MOZYCgue2kVbXpRfHdO7VwM=; b=U53MkUpGZxUFoV3g190vIj1bNiDfyviBkGMPotSNZdNjj15OSTKHV+w90Hcbwz0fKxdRdT H+Dd4E0rpXN4+ypMUZAlhjbaaGiBmm9oJUSUjA4/BSaZtNhi2uBiCmqaTCCnepWMCv0JXf pjXLxDORs5VqZUg0fZF9TfHrpL7Ad4M= In-Reply-To: (Alexey Gladkov's message of "Tue, 11 Jul 2023 13:25:46 +0200") List-ID: Content-Type: text/plain; charset="utf-8" To: Alexey Gladkov Cc: LKML , Arnd Bergmann , linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk, James.Bottomley@HansenPartnership.com, acme@kernel.org, alexander.shishkin@linux.intel.com, axboe@kernel.dk, benh@kernel.crashing.org, borntraeger@de.ibm.com, bp@alien8.de, catalin.marinas@arm.com, christian@brauner.io, dalias@libc.org, davem@davemloft.net, deepa.kernel@gmail.com, deller@gmx.de, dhowells@redhat.com, fenghua.yu@intel.com, firoz.khan@linaro.org, geert@linux-m68k.org, glebfm@altlinux.org, gor@linux.ibm.com, hare@suse.com, heiko.carstens@de.ibm.com, hpa@zytor.com, ink@jurassic.park.msu.ru, jhogan@kernel.org, kim.phillips@arm.com, ldv@altlinux.org, linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, * Alexey Gladkov: > The test marks as skipped if a syscall with the AT_SYMLINK_NOFOLLOW flag > fails. This is because not all filesystems support changing the mode > bits of symlinks properly. These filesystems return an error but change > the mode bits: > > newfstatat(4, "regfile", {st_mode=3DS_IFREG|0640, st_size=3D0, ...}, AT_S= YMLINK_NOFOLLOW) =3D 0 > newfstatat(4, "symlink", {st_mode=3DS_IFLNK|0777, st_size=3D7, ...}, AT_S= YMLINK_NOFOLLOW) =3D 0 > syscall_0x1c3(0x4, 0x55fa1f244396, 0x180, 0x100, 0x55fa1f24438e, 0x34) = =3D -1 EOPNOTSUPP (Operation not supported) > newfstatat(4, "regfile", {st_mode=3DS_IFREG|0640, st_size=3D0, ...}, AT_S= YMLINK_NOFOLLOW) =3D 0 > > This happens with btrfs and xfs: > > $ /kernel/tools/testing/selftests/fchmodat4/fchmodat4_test > TAP version 13 > 1..1 > ok 1 # SKIP fchmodat4(symlink) > # Totals: pass:0 fail:0 xfail:0 xpass:0 skip:1 error:0 > > $ stat /tmp/ksft-fchmodat4.*/symlink > File: /tmp/ksft-fchmodat4.3NCqlE/symlink -> regfile > Size: 7 Blocks: 0 IO Block: 4096 symbolic link > Device: 7,0 Inode: 133 Links: 1 > Access: (0600/lrw-------) Uid: ( 0/ root) Gid: ( 0/ root) > > Signed-off-by: Alexey Gladkov This looks like a bug in those file systems? As an extra test, =E2=80=9Cecho 3 > /proc/sys/vm/drop_caches=E2=80=9D somet= imes has strange effects in such cases because the bits are not actually stored on disk, only in the dentry cache. Thanks, Florian