Re: [PATCH v3 5/5] selftests: add fchmodat4(2) selftest
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Alexey Gladkov <legion@xxxxxxxxxx>
- Subject: Re: [PATCH v3 5/5] selftests: add fchmodat4(2) selftest
- From: Florian Weimer <fweimer@xxxxxxxxxx>
- Date: Tue, 11 Jul 2023 14:10:58 +0200
- Cc: LKML <linux-kernel@xxxxxxxxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, linux-api@xxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, viro@xxxxxxxxxxxxxxxxxx, James.Bottomley@xxxxxxxxxxxxxxxxxxxxx, acme@xxxxxxxxxx, alexander.shishkin@xxxxxxxxxxxxxxx, axboe@xxxxxxxxx, benh@xxxxxxxxxxxxxxxxxxx, borntraeger@xxxxxxxxxx, bp@xxxxxxxxx, catalin.marinas@xxxxxxx, christian@xxxxxxxxxx, dalias@xxxxxxxx, davem@xxxxxxxxxxxxx, deepa.kernel@xxxxxxxxx, deller@xxxxxx, dhowells@xxxxxxxxxx, fenghua.yu@xxxxxxxxx, firoz.khan@xxxxxxxxxx, geert@xxxxxxxxxxxxxx, glebfm@xxxxxxxxxxxx, gor@xxxxxxxxxxxxx, hare@xxxxxxxx, heiko.carstens@xxxxxxxxxx, hpa@xxxxxxxxx, ink@xxxxxxxxxxxxxxxxxxxx, jhogan@xxxxxxxxxx, kim.phillips@xxxxxxx, ldv@xxxxxxxxxxxx, linux-alpha@xxxxxxxxxxxxxxx, linux-arch@xxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-m68k@xxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, linux@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, luto@xxxxxxxxxx, mattst88@xxxxxxxxx, mingo@xxxxxxxxxx, monstr@xxxxxxxxx, mpe@xxxxxxxxxxxxxx, namhyung@xxxxxxxxxx, palmer@xxxxxxxxxx, paul.burton@xxxxxxxx, paulus@xxxxxxxxx, peterz@xxxxxxxxxxxxx, ralf@xxxxxxxxxxxxxx, rth@xxxxxxxxxxx, schwidefsky@xxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, stefan@xxxxxxxx, tglx@xxxxxxxxxxxxx, tony.luck@xxxxxxxxx, tycho@xxxxxxxx, will@xxxxxxxxxx, x86@xxxxxxxxxx, ysato@xxxxxxxxxxxxx
- In-reply-to: <c3606ec38227d921fa8a3e11613ffdb2f3ea7636.1689074739.git.legion@kernel.org> (Alexey Gladkov's message of "Tue, 11 Jul 2023 13:25:46 +0200")
- References: <87o8pscpny.fsf@oldenburg2.str.redhat.com> <cover.1689074739.git.legion@kernel.org> <c3606ec38227d921fa8a3e11613ffdb2f3ea7636.1689074739.git.legion@kernel.org>
- User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
* 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=S_IFREG|0640, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 0
> newfstatat(4, "symlink", {st_mode=S_IFLNK|0777, st_size=7, ...}, AT_SYMLINK_NOFOLLOW) = 0
> syscall_0x1c3(0x4, 0x55fa1f244396, 0x180, 0x100, 0x55fa1f24438e, 0x34) = -1 EOPNOTSUPP (Operation not supported)
> newfstatat(4, "regfile", {st_mode=S_IFREG|0640, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 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 <legion@xxxxxxxxxx>
This looks like a bug in those file systems?
As an extra test, “echo 3 > /proc/sys/vm/drop_caches” sometimes has
strange effects in such cases because the bits are not actually stored
on disk, only in the dentry cache.
Thanks,
Florian
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]