From nobody Sat Feb 7 10:16:16 2026 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (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 E118E426D23 for ; Fri, 6 Feb 2026 19:06:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770404762; cv=none; b=MprbPuKs4DgVgvSxKEOUQrsA8XyZ2yxbgguIOsuM2sXkMjL+jpjOmr2l/xWIfxRsQDVl0AidTo9ytJMOxRnYb5gM3ccIIePmn0ss2tH6OugDSai3SMDg+nxBdDLSS0pliSQm3yXnZx8sOPIMPDEG7NR2UIyf/HqsJ4PG/kUOiws= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770404762; c=relaxed/simple; bh=chxz5SueDmNOtWuRDFHcWjdP9erYQDc7P92CJU2kUSQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=j89iCrh4YktrWoHCZ2mxpUQT4m3fuWeygNgWyfoxtzeR5E9wL79IzlPAFs++Hb6w6ZH3he34U6iLwRNmR4x75tCtKXnmQoIFuPdaJ677VV7BUxpOEjkJ+l43z3SdbWnThbuFZlqBJtmFCjUFL7ETMAkSbJvYBOZ+qWwGikKll0I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eVfR8LuH; arc=none smtp.client-ip=209.85.210.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eVfR8LuH" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-8231061d234so2586761b3a.1 for ; Fri, 06 Feb 2026 11:06:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770404761; x=1771009561; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=a0RAzzsYhNATKDjt0+B8ASQxppYbfTlRqCJWuIOU5T4=; b=eVfR8LuHOpl8i+acFlSZMh1T1mG4suXvvhy9uK1cWvYASXbsNFduOEWbaoeAHglFtD SifaE8CQD7++yvOriALazJqU4OoimYJEvAAgDnXTjKbzNRjDNtrQaWRquvNxWKWvVDnM ZHKQaaT5acfE5DD6fZNLYhiLDq+oagWgvkF3OkfGb9MTDpSB57ABRMHpMu6BHZ8HUHAb I+CveQwwVTagc76SmoFGLty0+5BQZugf2DXzTO1m0ePJUGqj86XMVBftyfbghCG9nLu+ Tx3hZoXRbtFP4W1c9KDyQdufMZPmEJPLdEUkA2jtcIS5nD/7DBjZ+pAKPq2Vky09/8wT kioA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770404761; x=1771009561; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=a0RAzzsYhNATKDjt0+B8ASQxppYbfTlRqCJWuIOU5T4=; b=IcGaKGlwLTVcfYUXF51UiB31kOCOBwI5ohBomV1gob7uUC1PidX8A7Vh/SisQ7xj9g 11S16T1TQvbFUDvsZmoymS9MzzlJKcgpV+46+5z8bwzyNePCMLtd+z8b4kuQF2JdRHrx 7ilYknBQyvtYQ7HS0G8gk/LeJ1SkxQhGmPGxPc9WynaExpJC00fKwjUExOTXjwt2Boup xJRaUzrXN3X3CeJvuQcp6dyaqwsPiQsqlu90R4XtSp6wP69Bb3lNBPfXqit6CcCWXd7q NUMGKBYSJgFolwfoeZKeBg/n53soRHgp1AYy9mtjKdIDDomEeSODKXdFHsE66VnlxgL2 /fvg== X-Gm-Message-State: AOJu0YwrbxLi4w3yT2nGAJPTFkqRu6RYYFXRr/SXoXoLpYSsTdQzM+0X NJjTBV6daeC8rupRZ39CqfgM2/nHAE6ImYPnwBlbn12psEzz/lnOI8Jd X-Gm-Gg: AZuq6aJunhRKDdnp/wYwsNuZX8wOeKVc8y47pGNiy9tdnI4XtwhU+nf4QORLanh8zsw 8egaADpcxr+wsVKdFkwOZiJ83swP9Bh2mucJcJq2tfKQDVu66aCD2tDtlaFVTBA9JD1uwNz7oZX 5vLJLZF93LKaEVzo7z8Ntl0nC4UgxHGfGvAPcFrsmUgFTK7zRxuEQCyGtQD1zodDjwS8DGBbXIE RKM8QWwCjPNC+hS4H5F/ZuRlhSfG9QqGRbxjKIzBmLw9zlavoMLFxyaylaA+33Oc00YRChs2poy I7G8WFFLCabc6D50sF4joo/kD/XkNo3WtUXgKnJ7vwgbiysyCGibNCRsApE3hSfdNX/Zcmq+s4G zWsrFo8gC52klViiXqFqpV0um6bk5NAHSkhd5U+Iy6jCkAy2mb8l7iUciGEbOJ4dvib25ddy+uW eSzamS9z9zANGJ4AyoD07NJU9rib8nknsY4299vhe2pZU= X-Received: by 2002:a05:6a00:4487:b0:81f:4675:c2a9 with SMTP id d2e1a72fcca58-824413cb6b7mr3626544b3a.0.1770404761012; Fri, 06 Feb 2026 11:06:01 -0800 (PST) Received: from toolbx ([103.230.182.3]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-824418a70fesm2910894b3a.45.2026.02.06.11.05.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Feb 2026 11:06:00 -0800 (PST) From: Dorjoy Chowdhury To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, jlayton@kernel.org, chuck.lever@oracle.com, alex.aring@gmail.com, arnd@arndb.de, adilger@dilger.ca, mjguzik@gmail.com, smfrench@gmail.com Subject: [PATCH v4 1/4] openat2: new OPENAT2_REGULAR flag support Date: Sat, 7 Feb 2026 01:03:36 +0600 Message-ID: <20260206190536.57289-2-dorjoychy111@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260206190536.57289-1-dorjoychy111@gmail.com> References: <20260206190536.57289-1-dorjoychy111@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This flag indicates the path should be opened if it's a regular file. This is useful to write secure programs that want to avoid being tricked into opening device nodes with special semantics while thinking they operate on regular files. This is a requested feature from uapi-group[1]. A corresponding error code EFTYPE has been introduced. For example, if openat2 is called on path /dev/null with OPENAT2_REGULAR in the flag param, it will return -EFTYPE. When used in combination with O_CREAT, either the regular file is created, or if the path already exists, it is opened if it's a regular file. Otherwise, -EFTYPE is returned. When OPENAT2_REGULAR is combined with O_DIRECTORY, the path will be opened if the path is either a regular file or a directory. [1]: https://uapi-group.org/kernel-features/#ability-to-only-open-regular-f= iles Signed-off-by: Dorjoy Chowdhury --- arch/alpha/include/uapi/asm/errno.h | 2 ++ arch/alpha/include/uapi/asm/fcntl.h | 1 + arch/mips/include/uapi/asm/errno.h | 2 ++ arch/parisc/include/uapi/asm/errno.h | 2 ++ arch/parisc/include/uapi/asm/fcntl.h | 1 + arch/sparc/include/uapi/asm/errno.h | 2 ++ arch/sparc/include/uapi/asm/fcntl.h | 1 + fs/9p/vfs_inode.c | 3 +++ fs/9p/vfs_inode_dotl.c | 3 +++ fs/ceph/file.c | 3 +++ fs/fuse/dir.c | 3 +++ fs/gfs2/inode.c | 3 +++ fs/namei.c | 9 ++++++++- fs/nfs/dir.c | 3 +++ fs/nfs/file.c | 3 +++ fs/open.c | 2 +- fs/smb/client/dir.c | 3 +++ fs/vboxsf/dir.c | 3 +++ include/linux/fcntl.h | 2 ++ include/uapi/asm-generic/errno.h | 2 ++ include/uapi/asm-generic/fcntl.h | 4 ++++ tools/arch/alpha/include/uapi/asm/errno.h | 2 ++ tools/arch/mips/include/uapi/asm/errno.h | 2 ++ tools/arch/parisc/include/uapi/asm/errno.h | 2 ++ tools/arch/sparc/include/uapi/asm/errno.h | 2 ++ tools/include/uapi/asm-generic/errno.h | 2 ++ 26 files changed, 65 insertions(+), 2 deletions(-) diff --git a/arch/alpha/include/uapi/asm/errno.h b/arch/alpha/include/uapi/= asm/errno.h index 6791f6508632..1a99f38813c7 100644 --- a/arch/alpha/include/uapi/asm/errno.h +++ b/arch/alpha/include/uapi/asm/errno.h @@ -127,4 +127,6 @@ =20 #define EHWPOISON 139 /* Memory page has hardware error */ =20 +#define EFTYPE 140 /* Wrong file type for the intended operation */ + #endif diff --git a/arch/alpha/include/uapi/asm/fcntl.h b/arch/alpha/include/uapi/= asm/fcntl.h index 50bdc8e8a271..fe488bf7c18e 100644 --- a/arch/alpha/include/uapi/asm/fcntl.h +++ b/arch/alpha/include/uapi/asm/fcntl.h @@ -34,6 +34,7 @@ =20 #define O_PATH 040000000 #define __O_TMPFILE 0100000000 +#define OPENAT2_REGULAR 0200000000 =20 #define F_GETLK 7 #define F_SETLK 8 diff --git a/arch/mips/include/uapi/asm/errno.h b/arch/mips/include/uapi/as= m/errno.h index c01ed91b1ef4..1835a50b69ce 100644 --- a/arch/mips/include/uapi/asm/errno.h +++ b/arch/mips/include/uapi/asm/errno.h @@ -126,6 +126,8 @@ =20 #define EHWPOISON 168 /* Memory page has hardware error */ =20 +#define EFTYPE 169 /* Wrong file type for the intended operation */ + #define EDQUOT 1133 /* Quota exceeded */ =20 =20 diff --git a/arch/parisc/include/uapi/asm/errno.h b/arch/parisc/include/uap= i/asm/errno.h index 8cbc07c1903e..93194fbb0a80 100644 --- a/arch/parisc/include/uapi/asm/errno.h +++ b/arch/parisc/include/uapi/asm/errno.h @@ -124,4 +124,6 @@ =20 #define EHWPOISON 257 /* Memory page has hardware error */ =20 +#define EFTYPE 258 /* Wrong file type for the intended operation */ + #endif diff --git a/arch/parisc/include/uapi/asm/fcntl.h b/arch/parisc/include/uap= i/asm/fcntl.h index 03dee816cb13..d46812f2f0f4 100644 --- a/arch/parisc/include/uapi/asm/fcntl.h +++ b/arch/parisc/include/uapi/asm/fcntl.h @@ -19,6 +19,7 @@ =20 #define O_PATH 020000000 #define __O_TMPFILE 040000000 +#define OPENAT2_REGULAR 0100000000 =20 #define F_GETLK64 8 #define F_SETLK64 9 diff --git a/arch/sparc/include/uapi/asm/errno.h b/arch/sparc/include/uapi/= asm/errno.h index 4a41e7835fd5..71940ec9130b 100644 --- a/arch/sparc/include/uapi/asm/errno.h +++ b/arch/sparc/include/uapi/asm/errno.h @@ -117,4 +117,6 @@ =20 #define EHWPOISON 135 /* Memory page has hardware error */ =20 +#define EFTYPE 136 /* Wrong file type for the intended operation */ + #endif diff --git a/arch/sparc/include/uapi/asm/fcntl.h b/arch/sparc/include/uapi/= asm/fcntl.h index 67dae75e5274..bb6e9fa94bc9 100644 --- a/arch/sparc/include/uapi/asm/fcntl.h +++ b/arch/sparc/include/uapi/asm/fcntl.h @@ -37,6 +37,7 @@ =20 #define O_PATH 0x1000000 #define __O_TMPFILE 0x2000000 +#define OPENAT2_REGULAR 0x4000000 =20 #define F_GETOWN 5 /* for sockets. */ #define F_SETOWN 6 /* for sockets. */ diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 97abe65bf7c1..3d1f91220e17 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -771,6 +771,9 @@ v9fs_vfs_atomic_open(struct inode *dir, struct dentry *= dentry, struct inode *inode; int p9_omode; =20 + if (flags & OPENAT2_REGULAR) + return -EINVAL; + if (d_in_lookup(dentry)) { struct dentry *res =3D v9fs_vfs_lookup(dir, dentry, 0); if (res || d_really_is_positive(dentry)) diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c index 643e759eacb2..2e096eb0be11 100644 --- a/fs/9p/vfs_inode_dotl.c +++ b/fs/9p/vfs_inode_dotl.c @@ -239,6 +239,9 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct den= try *dentry, struct v9fs_session_info *v9ses; struct posix_acl *pacl =3D NULL, *dacl =3D NULL; =20 + if (flags & OPENAT2_REGULAR) + return -EINVAL; + if (d_in_lookup(dentry)) { struct dentry *res =3D v9fs_vfs_lookup(dir, dentry, 0); if (res || d_really_is_positive(dentry)) diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 31b691b2aea2..d0fa6cd65e0a 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -794,6 +794,9 @@ int ceph_atomic_open(struct inode *dir, struct dentry *= dentry, if (dentry->d_name.len > NAME_MAX) return -ENAMETOOLONG; =20 + if (flags & OPENAT2_REGULAR) + return -EINVAL; + err =3D ceph_wait_on_conflict_unlink(dentry); if (err) return err; diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index f25ee47822ad..cbc6008f6810 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -936,6 +936,9 @@ static int fuse_atomic_open(struct inode *dir, struct d= entry *entry, if (fuse_is_bad(dir)) return -EIO; =20 + if (flags & OPENAT2_REGULAR) + return -EINVAL; + if (d_in_lookup(entry)) { struct dentry *res =3D fuse_lookup(dir, entry, 0); if (res || d_really_is_positive(entry)) diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index c02ebf0ca625..1efb86b718e1 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -1385,6 +1385,9 @@ static int gfs2_atomic_open(struct inode *dir, struct= dentry *dentry, { bool excl =3D !!(flags & O_EXCL); =20 + if (flags & OPENAT2_REGULAR) + return -EINVAL; + if (d_in_lookup(dentry)) { struct dentry *d =3D __gfs2_lookup(dir, dentry, file); if (file->f_mode & FMODE_OPENED) { diff --git a/fs/namei.c b/fs/namei.c index d7923f2c7b62..a5ce3f91a283 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -4614,8 +4614,15 @@ static int do_open(struct nameidata *nd, if (unlikely(error)) return error; } - if ((nd->flags & LOOKUP_DIRECTORY) && !d_can_lookup(nd->path.dentry)) + + if ((open_flag & OPENAT2_REGULAR) && (nd->flags & LOOKUP_DIRECTORY)) { + if (!d_is_reg(nd->path.dentry) && !d_can_lookup(nd->path.dentry)) + return -EFTYPE; + } else if ((open_flag & OPENAT2_REGULAR) && !d_is_reg(nd->path.dentry)) { + return -EFTYPE; + } else if ((nd->flags & LOOKUP_DIRECTORY) && !d_can_lookup(nd->path.dentr= y)) { return -ENOTDIR; + } =20 do_truncate =3D false; acc_mode =3D op->acc_mode; diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 8f9ea79b7882..ae12bf75ad93 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -2315,6 +2315,9 @@ int nfs_atomic_open_v23(struct inode *dir, struct den= try *dentry, if (dentry->d_name.len > NFS_SERVER(dir)->namelen) return -ENAMETOOLONG; =20 + if (open_flags & OPENAT2_REGULAR) + return -EINVAL; + if (open_flags & O_CREAT) { error =3D nfs_do_create(dir, dentry, mode, open_flags); if (!error) { diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 5d08b6409c28..032fc3dbe992 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c @@ -52,6 +52,9 @@ int nfs_check_flags(int flags) if ((flags & (O_APPEND | O_DIRECT)) =3D=3D (O_APPEND | O_DIRECT)) return -EINVAL; =20 + if (flags & OPENAT2_REGULAR) + return -EINVAL; + return 0; } EXPORT_SYMBOL_GPL(nfs_check_flags); diff --git a/fs/open.c b/fs/open.c index 74c4c1462b3e..2cef40a3f139 100644 --- a/fs/open.c +++ b/fs/open.c @@ -1211,7 +1211,7 @@ inline int build_open_flags(const struct open_how *ho= w, struct open_flags *op) * values before calling build_open_flags(), but openat2(2) checks all * of its arguments. */ - if (flags & ~VALID_OPEN_FLAGS) + if (flags & ~VALID_OPENAT2_FLAGS) return -EINVAL; if (how->resolve & ~VALID_RESOLVE_FLAGS) return -EINVAL; diff --git a/fs/smb/client/dir.c b/fs/smb/client/dir.c index 747256025e49..fc77c5401574 100644 --- a/fs/smb/client/dir.c +++ b/fs/smb/client/dir.c @@ -473,6 +473,9 @@ cifs_atomic_open(struct inode *inode, struct dentry *di= rentry, if (unlikely(cifs_forced_shutdown(CIFS_SB(inode->i_sb)))) return smb_EIO(smb_eio_trace_forced_shutdown); =20 + if (oflags & OPENAT2_REGULAR) + return -EINVAL; + /* * Posix open is only called (at lookup time) for file create now. For * opens (rather than creates), because we do not know if it is a file diff --git a/fs/vboxsf/dir.c b/fs/vboxsf/dir.c index 42bedc4ec7af..936ba2962fd0 100644 --- a/fs/vboxsf/dir.c +++ b/fs/vboxsf/dir.c @@ -318,6 +318,9 @@ static int vboxsf_dir_atomic_open(struct inode *parent,= struct dentry *dentry, u64 handle; int err; =20 + if (flags & OPENAT2_REGULAR) + return -EINVAL; + if (d_in_lookup(dentry)) { struct dentry *res =3D vboxsf_dir_lookup(parent, dentry, 0); if (res || d_really_is_positive(dentry)) diff --git a/include/linux/fcntl.h b/include/linux/fcntl.h index a332e79b3207..a80026718217 100644 --- a/include/linux/fcntl.h +++ b/include/linux/fcntl.h @@ -12,6 +12,8 @@ FASYNC | O_DIRECT | O_LARGEFILE | O_DIRECTORY | O_NOFOLLOW | \ O_NOATIME | O_CLOEXEC | O_PATH | __O_TMPFILE) =20 +#define VALID_OPENAT2_FLAGS (VALID_OPEN_FLAGS | OPENAT2_REGULAR) + /* List of all valid flags for the how->resolve argument: */ #define VALID_RESOLVE_FLAGS \ (RESOLVE_NO_XDEV | RESOLVE_NO_MAGICLINKS | RESOLVE_NO_SYMLINKS | \ diff --git a/include/uapi/asm-generic/errno.h b/include/uapi/asm-generic/er= rno.h index 92e7ae493ee3..bd78e69e0a43 100644 --- a/include/uapi/asm-generic/errno.h +++ b/include/uapi/asm-generic/errno.h @@ -122,4 +122,6 @@ =20 #define EHWPOISON 133 /* Memory page has hardware error */ =20 +#define EFTYPE 134 /* Wrong file type for the intended operation */ + #endif diff --git a/include/uapi/asm-generic/fcntl.h b/include/uapi/asm-generic/fc= ntl.h index 613475285643..b2c2ddd0edc0 100644 --- a/include/uapi/asm-generic/fcntl.h +++ b/include/uapi/asm-generic/fcntl.h @@ -88,6 +88,10 @@ #define __O_TMPFILE 020000000 #endif =20 +#ifndef OPENAT2_REGULAR +#define OPENAT2_REGULAR 040000000 +#endif + /* a horrid kludge trying to make sure that this will fail on old kernels = */ #define O_TMPFILE (__O_TMPFILE | O_DIRECTORY) =20 diff --git a/tools/arch/alpha/include/uapi/asm/errno.h b/tools/arch/alpha/i= nclude/uapi/asm/errno.h index 6791f6508632..1a99f38813c7 100644 --- a/tools/arch/alpha/include/uapi/asm/errno.h +++ b/tools/arch/alpha/include/uapi/asm/errno.h @@ -127,4 +127,6 @@ =20 #define EHWPOISON 139 /* Memory page has hardware error */ =20 +#define EFTYPE 140 /* Wrong file type for the intended operation */ + #endif diff --git a/tools/arch/mips/include/uapi/asm/errno.h b/tools/arch/mips/inc= lude/uapi/asm/errno.h index c01ed91b1ef4..1835a50b69ce 100644 --- a/tools/arch/mips/include/uapi/asm/errno.h +++ b/tools/arch/mips/include/uapi/asm/errno.h @@ -126,6 +126,8 @@ =20 #define EHWPOISON 168 /* Memory page has hardware error */ =20 +#define EFTYPE 169 /* Wrong file type for the intended operation */ + #define EDQUOT 1133 /* Quota exceeded */ =20 =20 diff --git a/tools/arch/parisc/include/uapi/asm/errno.h b/tools/arch/parisc= /include/uapi/asm/errno.h index 8cbc07c1903e..93194fbb0a80 100644 --- a/tools/arch/parisc/include/uapi/asm/errno.h +++ b/tools/arch/parisc/include/uapi/asm/errno.h @@ -124,4 +124,6 @@ =20 #define EHWPOISON 257 /* Memory page has hardware error */ =20 +#define EFTYPE 258 /* Wrong file type for the intended operation */ + #endif diff --git a/tools/arch/sparc/include/uapi/asm/errno.h b/tools/arch/sparc/i= nclude/uapi/asm/errno.h index 4a41e7835fd5..71940ec9130b 100644 --- a/tools/arch/sparc/include/uapi/asm/errno.h +++ b/tools/arch/sparc/include/uapi/asm/errno.h @@ -117,4 +117,6 @@ =20 #define EHWPOISON 135 /* Memory page has hardware error */ =20 +#define EFTYPE 136 /* Wrong file type for the intended operation */ + #endif diff --git a/tools/include/uapi/asm-generic/errno.h b/tools/include/uapi/as= m-generic/errno.h index 92e7ae493ee3..bd78e69e0a43 100644 --- a/tools/include/uapi/asm-generic/errno.h +++ b/tools/include/uapi/asm-generic/errno.h @@ -122,4 +122,6 @@ =20 #define EHWPOISON 133 /* Memory page has hardware error */ =20 +#define EFTYPE 134 /* Wrong file type for the intended operation */ + #endif --=20 2.53.0 From nobody Sat Feb 7 10:16:16 2026 Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (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 0C544428842 for ; Fri, 6 Feb 2026 19:06:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770404767; cv=none; b=CxQjQgFkOqveXGvBdfUunQNNk7dYJBh8EtLamvb7ETsXn1C0DgvpUPQciOJ8I7zHihDisENYh09dUQzXA/tXbOlZCqbbqBTc52PUx3p+W+H1F96Fw5PHaBEM1F0hYEsWZc65S7nZJRjeMxJhllMeoQcfNKD9Aw6GKyGdi1v3hbo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770404767; c=relaxed/simple; bh=olEcfw2R3PxQccxo/a4AA9XQpy1FIiPSq7EJrYSF/Tc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ch+bzx5vHZ+uzZgohldQ7CDFAK31Ae5v8Me6Rq2WSwcUcsnAeCCqA2dBWIbQwh8lr4/h3EvXXAsMhNnMwiTRyrNXOQnsDnN0nVSS4/GYYlkqAlKWrjLaAe7aNyFPE5sApcT8zgHaCxYdPaE1e/Yx7cH4WpU869S3dHIC5TcHDwY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QHlcjyPe; arc=none smtp.client-ip=209.85.210.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QHlcjyPe" Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-82307c6902eso1299768b3a.3 for ; Fri, 06 Feb 2026 11:06:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770404766; x=1771009566; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/pb1U2+tXHG+cJ3VofgscQiI19w8OaU5clhJ5ujKhCs=; b=QHlcjyPeGqTGIhWhi0y+xrcQPm680CMaEJmHRflti4O9zE4R+6x3b8uDLX2o/3laa0 4lIhFn0cIcHw5SJBOVZa5pWuL2JCTq59sI/AYgh0LtnkfQYWsog1bKhdSs7AurpZiy4N an4gCTDfkfsLnblV/RLptIliEOPgLa7uRmdyWhsBJpqSsxLNtbCLQSivHTpaTzpk5oMb ssv5oOhI+2ycUxB0hqLBewcEcimFqcrHT96HFN4gsuT+yom0+OML2q2ovqX4Y0C0t1z5 KHWjmsH+8scN1Z/VvmKr43QhAO4Njj0uBmmNrHE6wCrOeI6YsmpLwI1RA/xW+DO0LCuy eM5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770404766; x=1771009566; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=/pb1U2+tXHG+cJ3VofgscQiI19w8OaU5clhJ5ujKhCs=; b=s1yzzNwV9i4iRfRZIsrCWd1TQTydiGr417vdaXMR2o26j7QqQ+ZDGSKyizJbYe6kh/ n20x34yKTgJbz2sZn1I/JyCvioSiEKaI8Xjem0kFsbtI8T4k2Vh5+n6p0WtXGkQErUnb u6Bb3FFeEMuaN61JGUMH/+FG5wap8t1OPlDNHua4LGG8Rtqmc5By/BOh8rtmfa1mDrc4 7VlPtZg7lTNjACr51g6ody0Vm26kCDXzHKcMeAqYL8q3+wQrjXfsKUb61he884XifCK+ 7osmF0qa6mRi9mnLrI0fuCCN+Ac3qSmcGuj2NPEzKeyv9wfpvlLFDkMMren7FSjisSjv oZZA== X-Gm-Message-State: AOJu0YySTA+cUgaCfrSr6hVlESEbOGaW1A/a94/gBs/hxi3cI5sZCcYv 7yrZbsppRY12EwuXgDEvZnw+sR8ucfrN2ZDPrMs3+V6+Vj1mi25ziVLD X-Gm-Gg: AZuq6aKYHZBk5xNw8e+fOWmL53mNvN0/EdPILern2usyapjwHU6u2Qw3E2+UNuf/hjn 0tQR6RWF2YK6Irt/bfZldhwTUyVdY+y21nzd039N1CTIBz6waN21zJWya4AJsxKmbH1WsuUuZ8W ic3P5wDOMI1Xp36isFuZekYmf0/+ALX5oFxM3OTXEKtyaiqU5cpxo2d2eK8f/9ekI+jUe3HQb8u isne70x4hQK5ePmo7LDVhef9JjDSEC7+YygN4U4PPnsZFZkt0lnOa5ECGfrFMxQtkCxFNcS+1Vr 35yR4BrRadVtWAZyIGb6WaCHN4w96J1HhyYIDyya1aczAeF1hErNPAe2D4GvmS34eWuSiKJ30CB KhppLVOmf7D0aKxUf/LoSNLoiwTDoyDMWXFt9L9Vm6xmdVVRGxV/k5jdLx9lKfvbZw+8V4keonY Wb5lisXWSgWC5eHzBLIf+PsmVuiRen3q02+1+vCsf6u+c= X-Received: by 2002:a05:6300:220d:b0:38d:fbb8:55a6 with SMTP id adf61e73a8af0-393af12003fmr3154475637.54.1770404766357; Fri, 06 Feb 2026 11:06:06 -0800 (PST) Received: from toolbx ([103.230.182.3]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-824418a70fesm2910894b3a.45.2026.02.06.11.06.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Feb 2026 11:06:05 -0800 (PST) From: Dorjoy Chowdhury To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, jlayton@kernel.org, chuck.lever@oracle.com, alex.aring@gmail.com, arnd@arndb.de, adilger@dilger.ca, mjguzik@gmail.com, smfrench@gmail.com Subject: [PATCH v4 2/4] kselftest/openat2: test for OPENAT2_REGULAR flag Date: Sat, 7 Feb 2026 01:03:37 +0600 Message-ID: <20260206190536.57289-3-dorjoychy111@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260206190536.57289-1-dorjoychy111@gmail.com> References: <20260206190536.57289-1-dorjoychy111@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Just a happy path test. Signed-off-by: Dorjoy Chowdhury --- .../testing/selftests/openat2/openat2_test.c | 46 ++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/openat2/openat2_test.c b/tools/testing= /selftests/openat2/openat2_test.c index 0e161ef9e9e4..238de9cff291 100644 --- a/tools/testing/selftests/openat2/openat2_test.c +++ b/tools/testing/selftests/openat2/openat2_test.c @@ -320,8 +320,51 @@ void test_openat2_flags(void) } } =20 +#ifndef OPENAT2_REGULAR +#define OPENAT2_REGULAR 040000000 +#endif + +#ifndef EFTYPE +#define EFTYPE 134 +#endif + +void test_openat2_regular_flag(void) +{ + if (!openat2_supported) { + ksft_test_result_skip("Skipping %s as openat2 is not supported\n", __fun= c__); + return; + } + + struct open_how how =3D { + .flags =3D OPENAT2_REGULAR | O_RDONLY + }; + + int fd =3D sys_openat2(AT_FDCWD, "/dev/null", &how); + + if (fd =3D=3D -ENOENT) { + ksft_test_result_skip("Skipping %s as there is no /dev/null\n", __func__= ); + return; + } + + if (fd !=3D -EFTYPE) { + ksft_test_result_fail("openat2 should return EFTYPE\n"); + return; + } + + how.flags =3D OPENAT2_REGULAR | O_DIRECTORY | O_RDONLY; + + fd =3D sys_openat2(AT_FDCWD, "/dev", &how); + + if (fd < 0) { + ksft_test_result_fail("openat2 should open directory with both O_DIRECTO= RY and OPENAT2_REGULAR\n"); + return; + } + + ksft_test_result_pass("%s succeeded\n", __func__); +} + #define NUM_TESTS (NUM_OPENAT2_STRUCT_VARIATIONS * NUM_OPENAT2_STRUCT_TEST= S + \ - NUM_OPENAT2_FLAG_TESTS) + NUM_OPENAT2_FLAG_TESTS + 1) =20 int main(int argc, char **argv) { @@ -330,6 +373,7 @@ int main(int argc, char **argv) =20 test_openat2_struct(); test_openat2_flags(); + test_openat2_regular_flag(); =20 if (ksft_get_fail_cnt() + ksft_get_error_cnt() > 0) ksft_exit_fail(); --=20 2.53.0 From nobody Sat Feb 7 10:16:16 2026 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (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 356EE330322 for ; Fri, 6 Feb 2026 19:06:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770404772; cv=none; b=cfGkMyuawAsP6rq7j04gZu/aBuODXf6/ZFUBL6ZbfMPbhMkokE0wJRtF0Qu1pMsxaFtcdvF3TYCeT4J5IEpB2C9Xa4GeEityQpCHxhPoXqda9xyHsp/YM0edRgA2O8jDhY4B1RvmX86SbrYW5egtX4TT2iqIYSY/V84qa0JfVsY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770404772; c=relaxed/simple; bh=Q9dm8LTnk+DFIEJAAB7tpFWixf8EizWYmak8EK7I1tg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YzPExHB8Swq9GOkqLID6hCCYPfwRKPuNRE9D1/OWKRGX0UqW4g4Uqr3in4cbdo9bRylLuNzDbb3y3av78EOGwe4qTTBmmjLeKWDTwTmlO75tbCRULeyisWBtAS8cO7KSbjIHZU1RwRasEKHms0/NUvBNiVDmbfZHisuhDxZ6j3Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XE7/SLuq; arc=none smtp.client-ip=209.85.210.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XE7/SLuq" Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-82318b640beso1389896b3a.0 for ; Fri, 06 Feb 2026 11:06:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770404772; x=1771009572; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Q4HfR25bhfBsIe8RbNyIL8PstGgybd8nsB9r91rb4k4=; b=XE7/SLuq8Z9OERS/Wo5Jgg2cOEndOZCIoJ+sj4JrT0fU118PKSPas7Jt68pvhd9AVr lcd4QwsGhdyjwRUrFuJ8IvJ8o75vsp6PI2CrcCN87fgmB7c9BdTWwrkJBcYfP1tR5kwi 5Gw/fdDH4n5whN690UkPgqBwVVigku+J43d0UKVtROtcWo1RHVa8n/tE+EfTlc+NdQBn OeHAL9rjmMrexTwLeMlOs7v69S7AZeGw/zCoOVJa+X7p2+GUpImhIQMiBrJMCAU7rSWA Js+wqcS1+kHqe5UvIrnfJ9v/GKxp1i73mVrP8dEwILphpw/EMb9ISYY3X5Y+N7LIIGYs icig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770404772; x=1771009572; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Q4HfR25bhfBsIe8RbNyIL8PstGgybd8nsB9r91rb4k4=; b=qnW0OtsoX+FxbN5L397BBlyibkFuVV+bVwnpiVKt9RxBSwg8a6qdXLXhasQJ5Tik+z PYZw8Ms8Lq0UijpYyQbOpaIlqxXNZRNWUcOucNFp+bXmxKOUl97DlO5HYRLnExLtg68K DiY7gVsQ8d1cklw/1Gg0yqoa8w70xwUy6+p3m5HIPHWbTn/7SbXttxTnpzRMGS9ThJza NLMioqm+aBy0RVtjWSIB6utHmayR8e6j7Z2aa6zwvw9BRZVCW3qYffNdXvOXNPIwTTaa 0Kd+34FXRRjQFHCsr7nwTE6bLfAXbEnlz4UwPKdTQSvDunWtZCpBZkL7hGmuwOMLX84j Ditw== X-Gm-Message-State: AOJu0YyA1rrM7nyne4Xha3l+/pn2X2sFfh5h/OU0JUP67LEPYKdaLt46 WM9+7cq8iVeM78IV5hTF4Y/PoXJskmIHoCmB+hQq2aPfhIaxxJlJcBAY X-Gm-Gg: AZuq6aJuM985nZgwRHg9iLR2cgAc/JGYS1R7+GrYBU516mKpiGISUi1HoNVOFxMNwD4 NMiVB+WGYbtaVcTkD4j3qnA2zRJ1JVOPiSp4QSJp7QWbrRrNsXuiNwtaJ6rjGpCdUu4g283gkcK e9SgWqExOXehF5ru8yK8mW8C37ypvdFjTC+dxGcvZRbAPCONJHc3TQm+72anquBNNvllMDUEmsK tQ2w8ArNKGbdlaNz60LczKD67iXnr09w4RwCP5M+ZMy/ewIpxt+EYzhavMKqu7LXL//dhztvFjD 9yPWJAX83SgsUBwGApY4bW7DGMmos23r+h01GTM8mm1AjiyzJ4z1G2aSZsWgqr7QqDb8NJYHtBP aZMl4F0CJ6lmGkaZAI41QJicm3jYLKy6w8ttmFhQrXGs1f1xyllr2tF/4FnEidIcgG+puKH9pZa xIsE/7iFBfmU2C9mHdFhvDzrMxoC4FEkH3RTsAaBnPFkI= X-Received: by 2002:a05:6a00:1941:b0:823:edf:9811 with SMTP id d2e1a72fcca58-82441631058mr3456881b3a.18.1770404771634; Fri, 06 Feb 2026 11:06:11 -0800 (PST) Received: from toolbx ([103.230.182.3]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-824418a70fesm2910894b3a.45.2026.02.06.11.06.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Feb 2026 11:06:11 -0800 (PST) From: Dorjoy Chowdhury To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, jlayton@kernel.org, chuck.lever@oracle.com, alex.aring@gmail.com, arnd@arndb.de, adilger@dilger.ca, mjguzik@gmail.com, smfrench@gmail.com Subject: [PATCH v4 3/4] sparc/fcntl.h: convert O_* flag macros from hex to octal Date: Sat, 7 Feb 2026 01:03:38 +0600 Message-ID: <20260206190536.57289-4-dorjoychy111@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260206190536.57289-1-dorjoychy111@gmail.com> References: <20260206190536.57289-1-dorjoychy111@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Following the convention in include/uapi/asm-generic/fcntl.h and other architecture specific arch/*/include/uapi/asm/fcntl.h files. Signed-off-by: Dorjoy Chowdhury --- arch/sparc/include/uapi/asm/fcntl.h | 36 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/arch/sparc/include/uapi/asm/fcntl.h b/arch/sparc/include/uapi/= asm/fcntl.h index bb6e9fa94bc9..33ce58ec57f6 100644 --- a/arch/sparc/include/uapi/asm/fcntl.h +++ b/arch/sparc/include/uapi/asm/fcntl.h @@ -2,23 +2,23 @@ #ifndef _SPARC_FCNTL_H #define _SPARC_FCNTL_H =20 -#define O_APPEND 0x0008 -#define FASYNC 0x0040 /* fcntl, for BSD compatibility */ -#define O_CREAT 0x0200 /* not fcntl */ -#define O_TRUNC 0x0400 /* not fcntl */ -#define O_EXCL 0x0800 /* not fcntl */ -#define O_DSYNC 0x2000 /* used to be O_SYNC, see below */ -#define O_NONBLOCK 0x4000 +#define O_APPEND 0000000010 +#define FASYNC 0000000100 /* fcntl, for BSD compatibility */ +#define O_CREAT 0000001000 /* not fcntl */ +#define O_TRUNC 0000002000 /* not fcntl */ +#define O_EXCL 0000004000 /* not fcntl */ +#define O_DSYNC 0000020000 /* used to be O_SYNC, see below */ +#define O_NONBLOCK 0000040000 #if defined(__sparc__) && defined(__arch64__) -#define O_NDELAY 0x0004 +#define O_NDELAY 0000000004 #else -#define O_NDELAY (0x0004 | O_NONBLOCK) +#define O_NDELAY (0000000004 | O_NONBLOCK) #endif -#define O_NOCTTY 0x8000 /* not fcntl */ -#define O_LARGEFILE 0x40000 -#define O_DIRECT 0x100000 /* direct disk access hint */ -#define O_NOATIME 0x200000 -#define O_CLOEXEC 0x400000 +#define O_NOCTTY 0000100000 /* not fcntl */ +#define O_LARGEFILE 0001000000 +#define O_DIRECT 0004000000 /* direct disk access hint */ +#define O_NOATIME 0010000000 +#define O_CLOEXEC 0020000000 /* * Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using * the O_SYNC flag. We continue to use the existing numerical value @@ -32,12 +32,12 @@ * * Note: __O_SYNC must never be used directly. */ -#define __O_SYNC 0x800000 +#define __O_SYNC 0040000000 #define O_SYNC (__O_SYNC|O_DSYNC) =20 -#define O_PATH 0x1000000 -#define __O_TMPFILE 0x2000000 -#define OPENAT2_REGULAR 0x4000000 +#define O_PATH 0100000000 +#define __O_TMPFILE 0200000000 +#define OPENAT2_REGULAR 0400000000 =20 #define F_GETOWN 5 /* for sockets. */ #define F_SETOWN 6 /* for sockets. */ --=20 2.53.0 From nobody Sat Feb 7 10:16:16 2026 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (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 363D942883D for ; Fri, 6 Feb 2026 19:06:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770404779; cv=none; b=q0ApIA4j71dIu0bEp5dvvafnCBbBBN+B+Ga4eO7Tg3m5yAKJyVujAT2hSbsu5NgbiFqGiKOCCEv1GCdqpHCw9azVVxNU+zo++/eFEsV6A7YFabf4RM9zlPY7/fn/ukVPzZoiB3istJKZW5gi8O16HpEl/1hl8hFFAoQvv/J5maA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770404779; c=relaxed/simple; bh=EKC+gjybz5QCo3/A2SoLkAdJ9dHzP8glwvLLU31BmCA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LmmZnKw6+2ZKRLzuOdxkBTjov5Po/9lVO96LCHJhj5RkVMauKudtP3WgzVvCIUukRUrjx8x1CfXl37Ftrh8rUF8RmgGgG9vZfulO1rdVrSm8FxSgtaGaxB/GEd1ug9HOg2y5Tn/v8GYhsf42CUCKLwNS4tTw8Q03LUl0Dv1lwDc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bwCwEiPQ; arc=none smtp.client-ip=209.85.210.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bwCwEiPQ" Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-81e9d0cd082so888623b3a.0 for ; Fri, 06 Feb 2026 11:06:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770404778; x=1771009578; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cE+gTqS6Acm3OjdFoCwcpAog50aFpqNiNU85af164dY=; b=bwCwEiPQ3D6Yd9OJ3BnC7yVyITJ51Toftb4FF5jyAPxGc/9jBp9fI0w4Sltb0/iHzD EwJpwyIpMMG83vGF8WDK+ABBZ4Mi1QWyf9gF0apnQCWms8ZMlNYmYj737T/gdBBUfp1P QDP5ckl/AuqsfRREYDO3Ss7n5j+jXyubT1yV5DQWenessukDzbh41SIKdoOtx2PLR/le GUbadvNDeV//L9riDv4fJhBTL92jIh08Ub5r/MxqrlEFl43uzykxZSLu9StONfTeKbfr nVybhU1ZgnZonAe8VlW2xzRzxPiYzNzl/n5QCq+yiAWNiG46mTDUyZCPm5g4XX3h6aR3 ySUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770404778; x=1771009578; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=cE+gTqS6Acm3OjdFoCwcpAog50aFpqNiNU85af164dY=; b=nXNPLoGRLIZuP9Tqf2A0Sf8C2mT9iGeR2qws6uQWcxH+G4BOxtru/tYP0LLf2UlvMO 7YW8J6fM090SuRB2PcQFIM+kQC2oj9Pjoz3nDy+DU2FXRa6lmIgPpOwXKSKQ13acJiWj 94BWslrMh7Ir6yAt5WoHEO2aXR9/5LWFgj4wn2NIFIhvFC35dOOrjROSBxcAp1Ui0Ajn zi0D3ZoEmyrW1rb9QMsSeXeL9CP1EdGlfEiXbIS5TWtyoftojV5Byl9fSXYV3ojc3ojv Ejq9mbc467/llXtU8a5v+a9mMm6RzL8yA7MtMMcWfjQLivDFQBvUNUvkTUEn79sEygAV IGng== X-Gm-Message-State: AOJu0YwrEbDgZTGb5H0INBqy6Z+H1SyWwQGA+CMk86hNC371i0ovnSlk XsYYYHA9DkMlg72rDcLsWGyvt2Pb9ec65QTTahWX8XlCfWwmkDOxQJyP X-Gm-Gg: AZuq6aIVO4I4/XlWgyMafgoty4YobGzL98icp/dG1PINyWzP+2kxEdVF2Ic+dT6dyrR IUNkXKzB1Y28+fCPrX61UPt0DDhdW/c1czfCy4mo4/ar4W7FlRmOEpDtJSH8gnZhrEn6hOXBS2M DyZrQs6ZfpyPBvx0AsX9l1+kk3kfBKs/GI2eErFc5eE6A2nywNgRFVkB19HIp/Y8Aa4/zhUaKF6 Vs+VZICETqQC/kx1Teb7Sf2cQ1xOaFcQuQyk3NpOWomqZ240rBJ2AkSGteiEKOejcRMRTQbsfz3 q5Nhf+IfDg0hzj0lTn3fqz9LgaWmPxUIi+7DZAKxkrh090mubJn0yy0tOLzJwy1leM2O6FaGzZY scfRFmtRzR4wQW0j9a9HSa1ZPQmbdY+jndQl/kOkVqryPhlUbIeFh+Bj9lJLCY+xRAKon+o0h2K jHV0tP2rFBz1VK1L3j4ZiGTQRRnPeNb2N+jIbUrtsn+p4= X-Received: by 2002:a05:6a00:17a7:b0:81f:4963:4967 with SMTP id d2e1a72fcca58-82441773190mr3407511b3a.57.1770404778398; Fri, 06 Feb 2026 11:06:18 -0800 (PST) Received: from toolbx ([103.230.182.3]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-824418a70fesm2910894b3a.45.2026.02.06.11.06.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Feb 2026 11:06:17 -0800 (PST) From: Dorjoy Chowdhury To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, jlayton@kernel.org, chuck.lever@oracle.com, alex.aring@gmail.com, arnd@arndb.de, adilger@dilger.ca, mjguzik@gmail.com, smfrench@gmail.com Subject: [PATCH v4 4/4] mips/fcntl.h: convert O_* flag macros from hex to octal Date: Sat, 7 Feb 2026 01:03:39 +0600 Message-ID: <20260206190536.57289-5-dorjoychy111@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260206190536.57289-1-dorjoychy111@gmail.com> References: <20260206190536.57289-1-dorjoychy111@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Following the convention in include/uapi/asm-generic/fcntl.h and other architecture specific arch/*/include/uapi/asm/fcntl.h files. Signed-off-by: Dorjoy Chowdhury --- arch/mips/include/uapi/asm/fcntl.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/mips/include/uapi/asm/fcntl.h b/arch/mips/include/uapi/as= m/fcntl.h index 0369a38e3d4f..6aa3f49df17e 100644 --- a/arch/mips/include/uapi/asm/fcntl.h +++ b/arch/mips/include/uapi/asm/fcntl.h @@ -11,15 +11,15 @@ =20 #include =20 -#define O_APPEND 0x0008 -#define O_DSYNC 0x0010 /* used to be O_SYNC, see below */ -#define O_NONBLOCK 0x0080 -#define O_CREAT 0x0100 /* not fcntl */ -#define O_TRUNC 0x0200 /* not fcntl */ -#define O_EXCL 0x0400 /* not fcntl */ -#define O_NOCTTY 0x0800 /* not fcntl */ -#define FASYNC 0x1000 /* fcntl, for BSD compatibility */ -#define O_LARGEFILE 0x2000 /* allow large file opens */ +#define O_APPEND 0000010 +#define O_DSYNC 0000020 /* used to be O_SYNC, see below */ +#define O_NONBLOCK 0000200 +#define O_CREAT 0000400 /* not fcntl */ +#define O_TRUNC 0001000 /* not fcntl */ +#define O_EXCL 0002000 /* not fcntl */ +#define O_NOCTTY 0004000 /* not fcntl */ +#define FASYNC 0010000 /* fcntl, for BSD compatibility */ +#define O_LARGEFILE 0020000 /* allow large file opens */ /* * Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using * the O_SYNC flag. We continue to use the existing numerical value @@ -33,9 +33,9 @@ * * Note: __O_SYNC must never be used directly. */ -#define __O_SYNC 0x4000 +#define __O_SYNC 0040000 #define O_SYNC (__O_SYNC|O_DSYNC) -#define O_DIRECT 0x8000 /* direct disk access hint */ +#define O_DIRECT 0100000 /* direct disk access hint */ =20 #define F_GETLK 14 #define F_SETLK 6 --=20 2.53.0