From: Christian Brauner Date: Thu, 16 Apr 2026 10:58:57 +0000 (+0200) Subject: Merge patch series "OPENAT2_REGULAR flag support for openat2" X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21688d812289d11ccf3018a94e0dfa2c98e73ec4;p=thirdparty%2Flinux.git Merge patch series "OPENAT2_REGULAR flag support for openat2" Dorjoy Chowdhury says: I came upon this "Ability to only open regular files" uapi feature suggestion from https://uapi-group.org/kernel-features/#ability-to-only-open-regular-files and thought it would be something I could do as a first patch and get to know the kernel code a bit better. The following filesystems have been tested by building and booting the kernel x86 bzImage in a Fedora 43 VM in QEMU. I have tested with OPENAT2_REGULAR that regular files can be successfully opened and non-regular files (directory, fifo etc) return -EFTYPE. - btrfs - NFS (loopback) - SMB (loopback) Christian Brauner (Amutable) : All atomic_open implementations were audited for OPENAT2_REGULAR handling. Explicit checks were added to ceph, gfs2, nfs (v4), and cifs/smb — these are the filesystems whose atomic_open can encounter an existing non-regular file and would otherwise call finish_open() on it or return a misleading error code. The checks allow these filesystems to return -EFTYPE directly and avoid unnecessary open+close round-trips. The remaining implementations (9p, fuse, vboxsf, nfs v2/v3) don't need explicit checks. They only call finish_open() on freshly created files (always S_IFREG) and use finish_no_open() for lookup hits, letting the VFS catch non-regular files via the do_open() safety net. Notably, fuse also validates the server response (S_ISREG check on the reply) before reaching finish_open(). * patches from https://patch.msgid.link/20260328172314.45807-1-dorjoychy111@gmail.com: kselftest/openat2: test for OPENAT2_REGULAR flag openat2: new OPENAT2_REGULAR flag support Link: https://patch.msgid.link/20260328172314.45807-1-dorjoychy111@gmail.com Signed-off-by: Christian Brauner (Amutable) --- 21688d812289d11ccf3018a94e0dfa2c98e73ec4