From nobody Fri Apr 17 10:35:53 2026 Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) (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 BF372326935 for ; Sat, 21 Feb 2026 16:36:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771691791; cv=none; b=hpcuVpvVPCsAi37OusD1iSFagXCXofZCYv3ECW/DSJIeqB5axmRC1ofF07OTGGaoisDJT4pDHqEERnsbh5FT5ibeNCGW6ssbJ5D0sP2Mbq0hzOujgNfwQaDc08wLvI1Gavcn+WGHXbGbNCcSS5Nxo6G7Hl4Fsksu56EkwQHBFH4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771691791; c=relaxed/simple; bh=U57Xqi41GmcO0x6P9Zx3BaCcGSfhRtmMSS7Uf1PuLxs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XFZm+FV2ZjQSp9ZtZiuRnWyxssuDY6C7+6ogugRW756OdWJO95VudaEI22mPuxrRYfHOC8YqUWb9tiplUtebg/pviurSvlHlSi0TdFcarvTJPUPGxqK4uvxPIgoO7F1yeGgiT2qsYWWyv8SApDsC/UlB3IlgHW4mZz96T0pLzFk= 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=hdmVeUhV; arc=none smtp.client-ip=209.85.219.53 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="hdmVeUhV" Received: by mail-qv1-f53.google.com with SMTP id 6a1803df08f44-8954ae375efso34733676d6.1 for ; Sat, 21 Feb 2026 08:36:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771691789; x=1772296589; 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=+im6HE0V+UhU/UpPycv1gj885b94imjLQRZ7n5HPX5c=; b=hdmVeUhVVDT9+aWOJnPeV5XvuJ/IiyXMbzsuQqineHd0flK0VInIH6ArrzkRBHBBSu MsSJG1rNnQmKCP/EvYUrZ91QaeGO9AjeYO0oq2p/sYRCWyAqXareZoKg21wgLV/QMYmC tHuJQISrQ4HQsmlGOL4ow9m7DuaahixzJPBG01xOVqF6tDk8RpTGdJX0lIIt1fzEjuDo PaMU55VSpwpifcklTwDANpLW0no/tDde+SaIJZrziK2+k4qCRcsJ2VBoHSB9+oZdU5qC RCItkdMRcerIuOYH1umM8DK+6ZcTtYtnI3pSJ66nFHgJ0Pd59MTQwQLdFcket3CZUfof 5xkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771691789; x=1772296589; 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=+im6HE0V+UhU/UpPycv1gj885b94imjLQRZ7n5HPX5c=; b=RLLjiRliPI3t8KY76a1dK/2r3yg+qjK3PVpibB5bKqhULTAdvBYeWnj9CV5CZ8MsVq vQQYs7hkgLnMxSUQ5Sof92VRlg2yFDjzZDnyb6HO50HWVL9TmJg12VWSG6b1eHuoLZmj o9zATos0P9kkIQaNHbFSOGI97nhEi4bccufEoOUaGSF44lavyb4K5t4wTMu6i0JPgxxc dyBgEcVNBEzY3DCUniox/n4sQHDy/2qDGYjy2vpX69VeIdYGETSMdkCC5FOfUbimr1Nm EW6wAviWrzIAhqoEUfyOWPYloJM1qQQTM3uQPKBqo8XkAYPY4GYY2j9iAtY6BeexB1W0 rZUw== X-Gm-Message-State: AOJu0YwO6JaXWlhrBTm3FeP4NM5OZT+mtfkayVewYuVb/ROnCZkk0CfQ 9Lj2FtLyfF0QkVp32eGnKN3INdRd1mPHT7kkMruoWYThv/A3GELEKfPd99E19Q== X-Gm-Gg: AZuq6aKwcD/m8q2cKB5qh7mc6b72VYsYYeNDuS4SksfWlqcDHIqdUzFmvmJ/zVVZf2X +dLJspeYwX/PCwTuMPELtSJDcifwaTqa6iepIAgPBQJ3yUYPdYASUWiVdjQtGDNfsyk/Mr5I2Da RLbHBU6cueGAwZX/yOF0JLE2/WNCBh/WqzG61Hw/AWt4Pa44JmjvyprUaB0iEC7DpMLpb/am/Ce ZJegYWuqd36Rsunm0R7YFBMCitBfAEIu1mGipROp+w4T+SChxxrRMer0j3Ifa6Cn5hKJ8zGmcJz PqKwCUsrX8BHQuU3ye/y6z4EAb2enPzev+gjEuVkYhOBSn0vo/Xabofuep6DrGbhROdMLnCmoJp q+WnN2+Ci/21WuhVjI2iJ4io2Krr+1o2J3o683ZHewkWPwjP0JmZYl3OYWg/KZbpAd90hNptN2Z Bs/9uZknKg4BjikWpbmW0i2HZG/0NQSUeL3uJb2PVZtkI4sCHNsO+OdPg= X-Received: by 2002:a17:902:d48c:b0:2aa:f5b4:9a2e with SMTP id d9443c01a7336-2ad5f7349eemr96972465ad.11.1771685998012; Sat, 21 Feb 2026 06:59:58 -0800 (PST) Received: from toolbx ([103.230.182.3]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ad7503f4a4sm23730205ad.79.2026.02.21.06.59.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Feb 2026 06:59:57 -0800 (PST) From: Dorjoy Chowdhury To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, ceph-devel@vger.kernel.org, gfs2@lists.linux.dev, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, v9fs@lists.linux.dev, linux-kselftest@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, richard.henderson@linaro.org, mattst88@gmail.com, linmag7@gmail.com, tsbogend@alpha.franken.de, James.Bottomley@HansenPartnership.com, deller@gmx.de, davem@davemloft.net, andreas@gaisler.com, idryomov@gmail.com, amarkuze@redhat.com, slava@dubeyko.com, agruenba@redhat.com, trondmy@kernel.org, anna@kernel.org, sfrench@samba.org, pc@manguebit.org, ronniesahlberg@gmail.com, sprasad@microsoft.com, tom@talpey.com, bharathsm@microsoft.com, shuah@kernel.org, miklos@szeredi.hu, hansg@kernel.org Subject: [PATCH v4 1/4] openat2: new OPENAT2_REGULAR flag support Date: Sat, 21 Feb 2026 20:45:43 +0600 Message-ID: <20260221145915.81749-2-dorjoychy111@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260221145915.81749-1-dorjoychy111@gmail.com> References: <20260221145915.81749-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 the 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, -EINVAL is returned as it doesn't make sense to open a path that is both a directory and a regular file. [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/ceph/file.c | 4 ++++ fs/gfs2/inode.c | 2 ++ fs/namei.c | 4 ++++ fs/nfs/dir.c | 4 +++- fs/open.c | 4 +++- fs/smb/client/dir.c | 11 ++++++++++- 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 ++ 21 files changed, 55 insertions(+), 3 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/ceph/file.c b/fs/ceph/file.c index 31b691b2aea2..0a4220f72ada 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -977,6 +977,10 @@ int ceph_atomic_open(struct inode *dir, struct dentry = *dentry, ceph_init_inode_acls(newino, &as_ctx); file->f_mode |=3D FMODE_CREATED; } + if ((flags & OPENAT2_REGULAR) && !d_is_reg(dentry)) { + err =3D -EFTYPE; + goto out_req; + } err =3D finish_open(file, dentry, ceph_open); } out_req: diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 8344040ecaf7..0dc3e4240d9e 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -749,6 +749,8 @@ static int gfs2_create_inode(struct inode *dir, struct = dentry *dentry, if (file) { if (S_ISREG(inode->i_mode)) error =3D finish_open(file, dentry, gfs2_open_common); + else if (file->f_flags & OPENAT2_REGULAR) + error =3D -EFTYPE; else error =3D finish_no_open(file, NULL); } diff --git a/fs/namei.c b/fs/namei.c index 5fe6cac48df8..aa5fb2672881 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -4651,6 +4651,10 @@ static int do_open(struct nameidata *nd, if (unlikely(error)) return error; } + + if ((open_flag & OPENAT2_REGULAR) && !d_is_reg(nd->path.dentry)) + return -EFTYPE; + if ((nd->flags & LOOKUP_DIRECTORY) && !d_can_lookup(nd->path.dentry)) return -ENOTDIR; =20 diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index b3f5c9461204..ef61db67d06e 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -2195,7 +2195,9 @@ int nfs_atomic_open(struct inode *dir, struct dentry = *dentry, break; case -EISDIR: case -ENOTDIR: - goto no_open; + if (!(open_flags & OPENAT2_REGULAR)) + goto no_open; + break; case -ELOOP: if (!(open_flags & O_NOFOLLOW)) goto no_open; diff --git a/fs/open.c b/fs/open.c index 91f1139591ab..1524f52a1773 100644 --- a/fs/open.c +++ b/fs/open.c @@ -1198,7 +1198,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; @@ -1237,6 +1237,8 @@ inline int build_open_flags(const struct open_how *ho= w, struct open_flags *op) return -EINVAL; if (!(acc_mode & MAY_WRITE)) return -EINVAL; + } else if ((flags & O_DIRECTORY) && (flags & OPENAT2_REGULAR)) { + return -EINVAL; } if (flags & O_PATH) { /* O_PATH only permits certain other flags to be set. */ diff --git a/fs/smb/client/dir.c b/fs/smb/client/dir.c index cb10088197d2..d12ed0c87599 100644 --- a/fs/smb/client/dir.c +++ b/fs/smb/client/dir.c @@ -236,6 +236,11 @@ static int cifs_do_create(struct inode *inode, struct = dentry *direntry, unsigned * lookup. */ CIFSSMBClose(xid, tcon, fid->netfid); + if (oflags & OPENAT2_REGULAR) { + iput(newinode); + rc =3D -EFTYPE; + goto out; + } goto cifs_create_get_file_info; } /* success, no need to query */ @@ -433,11 +438,15 @@ static int cifs_do_create(struct inode *inode, struct= dentry *direntry, unsigned goto out_err; } =20 - if (newinode) + if (newinode) { if (S_ISDIR(newinode->i_mode)) { rc =3D -EISDIR; goto out_err; + } else if ((oflags & OPENAT2_REGULAR) && !S_ISREG(newinode->i_mode)) { + rc =3D -EFTYPE; + goto out_err; } + } =20 d_drop(direntry); d_add(direntry, newinode); 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 Fri Apr 17 10:35:53 2026 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.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 6CF2920298C for ; Sat, 21 Feb 2026 15:00:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771686016; cv=none; b=hJkQlhTDAfBPRj9M0+r1HIiEOHv8abahyKT52WYs4ID43GRpIu4uuAa9Jk0BI0itJmMbKK2jOitZsPWky+0cEmxr/jSk9lxNPuDcZCZ+wy8oGp0T2W61P1fBeLwaTxmc1SX5rmSsICYwGmAyM2O6TJhQeQkInyXmuQPr/AKRIoU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771686016; c=relaxed/simple; bh=QvKBTacd5z2P43CbYauz1u/x08KHhA7f2Nkz0BaL8og=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=m/mUzP8qAX8WLJGkKzX2TpjsGHSXS7s+/cQdLGjvxR8koPYE9UQVyDgBl8bKUIBaqHRJse3l23aHxj4BQN4d+EzSUyaH86km8ZvWBiMuq6Qdz1QFurkd5FJVRB4fcEchaqGuHeCGDau8S2RQ9CB51GwleNI8JGW7eMI5Sd5WgV0= 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=HxXo1FNQ; arc=none smtp.client-ip=209.85.214.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="HxXo1FNQ" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-2ab47d8b33cso16443055ad.2 for ; Sat, 21 Feb 2026 07:00:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771686015; x=1772290815; 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=/Vj99fOR8e2nvanig9cWTi+niKOe1ygt4TyyqPTa8nU=; b=HxXo1FNQuictopvLvnMkkZF5qodgQm+CYcyPPDQ8Og5uuTEg8rF5yGBum+x5zMOQWr RvPO1ZxGlpScDgjyMR0rrHwffhv7yLXmL8bJ2U74qkQLdb5LSZokDK+bZOj2Th+AAJv5 bV9W7TIWXsApKKvSYN6QsZgkuySNy4ZbuIHPzVtlo7MK9Mluxab3J+4vIojO0UNgXPHq 6PVAxGip+VxCeZRWLGvNrnt3WqjVDlGLcLkcUrFiJtYI+r5DiJdb72z5mkpqEYVgubHs 78aQCg11QOI1Yx93trR0N4bp3bKEbbiQ5wHrbM6Zn/JFpHlZejrHtpBPowm3RU+CKfsB ho9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771686015; x=1772290815; 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=/Vj99fOR8e2nvanig9cWTi+niKOe1ygt4TyyqPTa8nU=; b=B0bjUt0ozc7eBUCEyJiGR7aHqSD7m1u7cjVszWhJ086t82M0SZ8lGPSa5sg1LugB3R liYayT293UEqmFpElWXbQ5HlgYMCr4773/WA1Gi91ysvso4wvAL3I6BI5vd6cMfxz5ta 7qmXY9kZGoBH2PnpJi3ELWufVDxmymIKSJ6UASHMEbKDX0QYuQhoGAKGGooqeG4VeXyg 2VJXIYP5SDO6FZ+RhQSW/HB/2as01slENErCl+GIRQ2Wl8G8DiaYpv+iMjogZ+efxaZZ 6FNznidAHMLwJ1LxnBDVT++EsLrNvYJeQfYOwtTpqgvb0i4i0K79KaA4CQW8nhr8T2/7 6N5w== X-Gm-Message-State: AOJu0YxpJ4GcCICOhmHf9f8ChnDcIYpWnEemI0Z2SgMZnv1x4uBoDBTG k9pP7azlDLwT7ZizqPmlw//N8AHLgS0cp0c8B3ywcH+wzMjsl3EETYRn X-Gm-Gg: AZuq6aKrABKxR2SG6WffWzxEzkTx0t7qgg2o8sKQt2GUw1GT/XWtKVdRpDqkApsmCTW XNnQVd8keIsloiNwhRlGT+ELSMijxVRdCTdJwy9GXHK+nXKnmCQI8Nl7cACpMAfws+FlqwDJeux /+p0peBr+6Ci1IjX58CAtet8Qo76OrCgfuEzX1NXGTMu7TYZpYflmHYGDHVyGpuAFTQrTU2Kvp0 W/gHq2XVOvTTuGd9radxEEeh07X/1VJTzgHid9Wy892XArze8nRhleJD76nS6K9ULwXptiae7aO /cSlZYQDq8xCuGYnVmJ+rTOX2wQoKAEG/cO6vyFZ641EhBVuzSDga5scX2w22IzFCc8e3q2Cw7V cVRooRMtv5gvZm/heLUSAeV9ZR2NNTCSisSpo97IroQorjV5FERRr4B1ztQBnUBNuoKfH4kl6s6 PuWhR3KPuRQKHxhPWFFNFzNcDLoDgZRQCB2sUUKMPdR1S1YIbH0tNE3XM= X-Received: by 2002:a17:902:cf07:b0:2a9:322e:2473 with SMTP id d9443c01a7336-2ad7457e58dmr34715235ad.48.1771686012796; Sat, 21 Feb 2026 07:00:12 -0800 (PST) Received: from toolbx ([103.230.182.3]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ad7503f4a4sm23730205ad.79.2026.02.21.06.59.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Feb 2026 07:00:11 -0800 (PST) From: Dorjoy Chowdhury To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, ceph-devel@vger.kernel.org, gfs2@lists.linux.dev, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, v9fs@lists.linux.dev, linux-kselftest@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, richard.henderson@linaro.org, mattst88@gmail.com, linmag7@gmail.com, tsbogend@alpha.franken.de, James.Bottomley@HansenPartnership.com, deller@gmx.de, davem@davemloft.net, andreas@gaisler.com, idryomov@gmail.com, amarkuze@redhat.com, slava@dubeyko.com, agruenba@redhat.com, trondmy@kernel.org, anna@kernel.org, sfrench@samba.org, pc@manguebit.org, ronniesahlberg@gmail.com, sprasad@microsoft.com, tom@talpey.com, bharathsm@microsoft.com, shuah@kernel.org, miklos@szeredi.hu, hansg@kernel.org Subject: [PATCH v4 2/4] kselftest/openat2: test for OPENAT2_REGULAR flag Date: Sat, 21 Feb 2026 20:45:44 +0600 Message-ID: <20260221145915.81749-3-dorjoychy111@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260221145915.81749-1-dorjoychy111@gmail.com> References: <20260221145915.81749-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 | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/openat2/openat2_test.c b/tools/testing= /selftests/openat2/openat2_test.c index 0e161ef9e9e4..e8847f7d416c 100644 --- a/tools/testing/selftests/openat2/openat2_test.c +++ b/tools/testing/selftests/openat2/openat2_test.c @@ -320,8 +320,42 @@ 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; + } + + 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 +364,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 Fri Apr 17 10:35:53 2026 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.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 2E234219FF for ; Sat, 21 Feb 2026 15:00:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771686029; cv=none; b=EkGIPB5slme9BLHfz5Gg7Yg9Tpi8oT+jZswVGx/R6d5Hk/XgmApWxp27eYfDJIDyAkTF9k8sQ90C50zjhdA7SUfW3ymWebcVEHhbHSBCbMpVxWZvhTwVsYp4yX/A5nT46actYIZwyfQTZyOAg/CDhRCyQD046YfTcElM5MFTPdo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771686029; c=relaxed/simple; bh=Q9dm8LTnk+DFIEJAAB7tpFWixf8EizWYmak8EK7I1tg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MRMvpxUIsjXxWT1skQ/DPrrtswNzTGnUXFMkd2wLn9HuqWjQVKoOMqHfPqRc0w3xqqCraMyLIz9wBxc0PSXnsx0fc0ayaOdKgs01EIE4b6+DUFdpksXAYcynrYW31vphQtmBjJpu3w8lWoMoGruMK53o4HUJZ+zfBzJpBX78Hac= 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=BGqGnW7k; arc=none smtp.client-ip=209.85.214.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="BGqGnW7k" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-2a77c1d5c3bso12558865ad.0 for ; Sat, 21 Feb 2026 07:00:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771686027; x=1772290827; 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=BGqGnW7kOylOdvyrZ4z1lT/ecUHtGqCYxKHr6UhAyPkl9syEx7FrPfoxqn+cYX7/ha 6vhlJQQ5BpXg689JLYfif9oSifbLc7cZP1aDD7G24QoyJxmqLBOHqj7LPHQv1yBHjJL7 kWeEsiRuG+7Z7/bP7XyqoKaKOOJNoJR3d8j4+G5K0SH7dahsmuLWDy6LnSGUPd2g5gS8 yP0IbSfc9xmK29adTLYKqQTzV9U7v6x39Auzdv5eHQOkyvnk/rFZg5KMz2n6PyGFACxj qa4gdgzn7GmBFNKK7fBiVAWhESDIuEzTReqEdY2iCvLpl2QPY7M/83OsbcSLtZ2RFMdv tjgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771686027; x=1772290827; 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=Iv7OKUTnugOEfvvNq3IbwqkGpBvObX+6BC/DPDYP21ak7EGnNWqZNbNPQZAZ1VrMZ1 3cU8ITpgpJE0TdtI41wE8yCpKRmvjz9sUfx6N1HlLOb+kH4RCMDtoTfyTRAd/4ApMlaO tCh/eGLSNExWd1u4ZycWWhAGpX6xtPrLYkMC5mmXoEWAakpm3gN8cVbVU224VihFyq+u lQSnqg3+w5LI+MlfTb4k4kFS5rAWakXJBDLXLAkW/VI7ZrNyWqs9fC2X4+FuO13a66bt gEYBZotGpZfuAgkivGYGcJlCxjKTibFZR2tFUS2O5U7cG2c/AqulrJqYPyegNUxglVuD EbSA== X-Gm-Message-State: AOJu0Yxlnm4ZN7ZhMtbBzv0bPvX5CzSJbL67PthZ5t47QsI3CXB5q9yz 82MSM2lGHNxayHaSCRaSXj7x3+iff9jZugsrwp2pxVyX1DkY/4yOurtu X-Gm-Gg: AZuq6aJfxGP65tQr60TSV8XG6HjPkw39PDhgSTQHXhjW41DGq1o1Bib0fPNZD2kkuFv FNZqiMUy4uzIxcdgw/no2IP5n3spbPBO/EyClWgLb/epUw6wIMYFcsL+R4+vyYCMYLCxgUFppgS pnt3iUt5xnNocQ51bRG4EXzNBSyN/4TmVxtiQcM5sHSQF4nAb5jZjk4nRpymtLUPnPvP64L8Ups PkeJylbCNQAo3NdSQGek77/VliyncfaOhQjxAqWFFbXRxxtic2Na1TLm/puy1OIM/ThN+PaFbZN E4S9Uf9wJwz/IwuH9bZWk+488rFFYx0//l8xybRo1isYxNMug1sxH8yAIPlkTNghGnadVJcHSh/ cgVEvU/mYDlRhIbyGKMTDYErDO8OXS8cZwoRaK9O52i4tJlskC5ahhRhTCpjI6fuMQDACZvaZbu MtKTO0Ln7s09r7ZskDiAqaDONShc65xtBjZyLELnbtg+0aG8DeD6XXi8E= X-Received: by 2002:a17:903:3510:b0:2a0:fb1c:144c with SMTP id d9443c01a7336-2ad743fe17amr28627765ad.5.1771686027291; Sat, 21 Feb 2026 07:00:27 -0800 (PST) Received: from toolbx ([103.230.182.3]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ad7503f4a4sm23730205ad.79.2026.02.21.07.00.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Feb 2026 07:00:27 -0800 (PST) From: Dorjoy Chowdhury To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, ceph-devel@vger.kernel.org, gfs2@lists.linux.dev, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, v9fs@lists.linux.dev, linux-kselftest@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, richard.henderson@linaro.org, mattst88@gmail.com, linmag7@gmail.com, tsbogend@alpha.franken.de, James.Bottomley@HansenPartnership.com, deller@gmx.de, davem@davemloft.net, andreas@gaisler.com, idryomov@gmail.com, amarkuze@redhat.com, slava@dubeyko.com, agruenba@redhat.com, trondmy@kernel.org, anna@kernel.org, sfrench@samba.org, pc@manguebit.org, ronniesahlberg@gmail.com, sprasad@microsoft.com, tom@talpey.com, bharathsm@microsoft.com, shuah@kernel.org, miklos@szeredi.hu, hansg@kernel.org Subject: [PATCH v4 3/4] sparc/fcntl.h: convert O_* flag macros from hex to octal Date: Sat, 21 Feb 2026 20:45:45 +0600 Message-ID: <20260221145915.81749-4-dorjoychy111@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260221145915.81749-1-dorjoychy111@gmail.com> References: <20260221145915.81749-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 Fri Apr 17 10:35:53 2026 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (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 8EE3A1B4F09 for ; Sat, 21 Feb 2026 15:00:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771686043; cv=none; b=vAMKE8ekoPL+yfvpJhrX1vZMHxmfj9H+27gwCUK4lPMnZ/lEDwWvg4qxAcVjMPHUEGASXIb6NVW3XYMIb7jLNbRU2NHnipEVwH9gZjuvjy4QfWBf+6cxMjULYiD+TelLyk2q5Cb7UEibFfEX++BGZBAQbYIhZsWmMJFIW9wplnk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771686043; c=relaxed/simple; bh=EKC+gjybz5QCo3/A2SoLkAdJ9dHzP8glwvLLU31BmCA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X3QE5U2HQKUHiLHSYjyyv0h28CI20uAiujzwq7x5N/1g/IJXv/P8VSGl33nTPXH41tKGVU/ZEK1XEbPFQ3bzlOzGgNbh8fRXmzlFTmcoAy7Cymu7CUjrPj6YbkpogJ+cU9LwFAcH9U0ZQgYaRg1JAJ8C0fyMXqslhehk5avfbTg= 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=Kk2tUUGw; arc=none smtp.client-ip=209.85.214.170 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="Kk2tUUGw" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-2a91215c158so20119315ad.0 for ; Sat, 21 Feb 2026 07:00:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771686042; x=1772290842; 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=Kk2tUUGwvD9uGvq0ltLEbkA6gi0NU9z4MP00tht7MoU2o6bKhEQ6dueKkPeMGPqu3T r+i2gbnfgZqBNGm9kfrCE7+uSZaWCNdYObcf3IJCxMQxdP8lSS640twG57Zp/TxJBeCH eKkXO17an2qluj9ez+oUTd/Mjhb0d5rImThkDbDzR/Zh2No26sF43Q7+08D7P7ZgelBW ac9A19JzfVstuTVnX1ktYq+qhw9iN5VSre+latY9KomlTbH81/2Sw0Il9oIKwc5VdSJ3 cykMuY6M7c07+TCRFacC4SoRR3WRJCkXs+Tao3xNxLET/B8qr42QlE2DCWV09ZTsAoLd g+mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771686042; x=1772290842; 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=oinONwCZcnOXdn5Rd3PwATZKoCBl83XJzr+/C2+TIlB74PuOd9+b83sSX3NW+HFPJv sFJaTZ4TGdU/XOQuEzmcpL77fAzTSKx7a0GUMnZqxSCqNlyGzLzCh+t+WQVgUVLfeAi5 UQcuyPbhRakI1X7CwSU036GJr8MRnsbW89/NE6LeGrsKQHmPZnkINe2yLm2h2/jWTn1j nmNcCwPb5sIXHVIt1sm2Mf7UpXY4V/3zl3p07FJP06SczVmAfzJSGG7ksxzFOfphXXjP iav9Lawyv/P9i3ct+5fsrfVpBOhMzd4/b+VtB1F2kfA7VJ4FTVgmiv1DnVlABJYUpy2Q R6+g== X-Gm-Message-State: AOJu0YwtkTWOsdyvM8r1IZI24EeOQyFd8yiGYDnBYbGYNr5bPlMBHIEh sSPqpHv2VnVHAc/0i9td9ifW2i6q/AKdRXIiJ186mhuo0ZiotKnW0pb9 X-Gm-Gg: AZuq6aJRqxW8Owo2+n3655KgWcRK5zROJS2OPGdpGv3zLtyxqLaPy+wnjVczkkWFBPA gMBstVRe1S7Q0vktuzkki8mUML9aOYStf+lXvpQMnRbIK6vdgzIT/2CwL3KwysPsOHbJkyHYrqU POGu4Oxu7+0sk2kWiLIU4v8IKn0dnWzWWwQgnbErxOywM0UgLyVtsW9AC+QxCNgL/8CGtzp6HA2 r9qJxsFaJDTVgmMmfAwlm/fQeyDz9OYRTqTbd2fXPoTMk0H6QlVw3prJOCP85e8zdqKZ3E3e8Rb 47922oatcYiHO8smBFFXO+hRZdVOvDTUZ5zjEDPQjXDHV0JShhnkXyO/JAIzWVyoNlSkeO+5zKX GR2SpBJP4SJu73KMw4hiZJ86B+jwDRI8E+nMBepZ2fIhCdd+Uuk0GZcmdFqurirAf+Ky+8wn5Z1 9i9wtldRJNZPLsTto2Fk9PKjZXJVCnE7situfqdERlu/CAAffse0iaX1o= X-Received: by 2002:a17:902:ce90:b0:2a9:5b28:94c0 with SMTP id d9443c01a7336-2ad744e13bemr26077275ad.27.1771686041931; Sat, 21 Feb 2026 07:00:41 -0800 (PST) Received: from toolbx ([103.230.182.3]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ad7503f4a4sm23730205ad.79.2026.02.21.07.00.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Feb 2026 07:00:41 -0800 (PST) From: Dorjoy Chowdhury To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, ceph-devel@vger.kernel.org, gfs2@lists.linux.dev, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, v9fs@lists.linux.dev, linux-kselftest@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, richard.henderson@linaro.org, mattst88@gmail.com, linmag7@gmail.com, tsbogend@alpha.franken.de, James.Bottomley@HansenPartnership.com, deller@gmx.de, davem@davemloft.net, andreas@gaisler.com, idryomov@gmail.com, amarkuze@redhat.com, slava@dubeyko.com, agruenba@redhat.com, trondmy@kernel.org, anna@kernel.org, sfrench@samba.org, pc@manguebit.org, ronniesahlberg@gmail.com, sprasad@microsoft.com, tom@talpey.com, bharathsm@microsoft.com, shuah@kernel.org, miklos@szeredi.hu, hansg@kernel.org Subject: [PATCH v4 4/4] mips/fcntl.h: convert O_* flag macros from hex to octal Date: Sat, 21 Feb 2026 20:45:46 +0600 Message-ID: <20260221145915.81749-5-dorjoychy111@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260221145915.81749-1-dorjoychy111@gmail.com> References: <20260221145915.81749-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