From nobody Thu Apr 9 14:58:08 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 556F61C6FF5 for ; Sat, 7 Mar 2026 14:08:10 +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=1772892491; cv=none; b=a18SqLyb4mwjoiu3sWx5BEMqxftCrZ1BrrBP5BEmLe1FiEpBucXMSvEmME0gUa00WSshO2mvRtw3UEQNbDCC77u7Pjr8HSb2HGnzjm1F5gQLJ0fKDP2fOUIFxNVpeibbvmxzTeOA7v8TEWo3pTy0Z8MKag2IcMwY1k2clk5niAg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772892491; c=relaxed/simple; bh=zDe66l+JmveQecNMVrCRrjZg5uSfm7CXpKeeZBowzy8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pMLXa0yXkTiSpi1OaCf1gwgBoPCCPKkuyTY7P7VGcvZzg54doZJNpLFyGACKI/2GgX41/LUk8sYDJ+DpSJh/ZgNMKz0JYoDXUi/y9ZbAq8dCar8s5ky+8HnNKjpY4ZOhGFDWzXuNtW44FoE1PsVfS7ZEnJ2AEinmwu9ajLICFxE= 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=G7cOuEHd; 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="G7cOuEHd" Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-829781b2b01so2417971b3a.2 for ; Sat, 07 Mar 2026 06:08:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772892490; x=1773497290; 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=oYXSGitRcLBWptWoZgMY2ifQQ0cLoy8/syvj4kUgg04=; b=G7cOuEHdKfRh25r2R8OqT3Gt6TS619/WSIcwXqzbOEtk8AtybYC5AeuWUf1B5HB5bV hnNo+76kJ+w7BqgJnkSTS+7HYUq0blvJfBFZtA5+r0VXbsXM8YpQwVQ8JMwJ+gTcibBc KOZUB3KPL2UBsCHDBm/e4g2O/OCv3HzJ85CPT9z96JjBm3DoXOgc/Ia4If/NbLMT5tua RN64M2XQrKYjD/CPGY+Wl3av5/wzlyZwCX9bDdK6m6lBy+Kfwq7Nqx0+PWfT9T0CF1kk swQTyUK1kms4X2UxFGLcZ7l6byRyIvbjuTN2h2G/aXRmSyo2kBpc0IbpZjkgZLVX7M9T rBEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772892490; x=1773497290; 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=oYXSGitRcLBWptWoZgMY2ifQQ0cLoy8/syvj4kUgg04=; b=erZebn3Inu6akhiqNvBZ36qJnEGrIiBoyHJ58V9ugSWm3twTFEqvujKxN1Q48v2Jgn SPATdSN50mybwjdqMl7oo4Iv2feKPh1LAZVvGXb3w+9dF+6ATI/8ZFQu3P7P6vJYQoKp 8X6XcGH2P405Zi0F6BTBcKwnf4TNmaKbb9Oj46Lo27PH1dVzTBhxXW0uligCucF6XJHU z6uoATE2mMOtfIKfJo0MUcglPz4+DhsKj23/vxGQEha7iAe5wg/pmtUXZ1K/uNKmJf3C pyeg4m9I7o9MimqOo6Rj3J1lkcfIBVVb6BTOEqFddIGWhSPtVE9k4jlUuEjYbpel2BQ6 +ACQ== X-Gm-Message-State: AOJu0YxGZma8LNnbz+blCQjOafocZPjEvBi/Rg94P/1wEM8GiA/8L1dO eVLgpQN9qFQEHv6d3eBp3neIZfhDRAeFS2O93D05MDABrmYgnwQKSs5x X-Gm-Gg: ATEYQzzGpvhTzkaIHq2/IdWQ5s6lmR/pKwno/2FN0fMla3QQnpvC10fKHTkVxvEKitB PeNdTJ+jlrfp1jYF/wGP2p0xjLif0bjqwwUPAIELPZwMB0csoRNnVkeC21JOvG/Mk/Yodld0s3F K/a2cOWmV6IsppqSOlgIGEpu7o72Iq75NKslwQsQItLdezTPa6UCWgexCkVXH4lRz9p8vjv1JHO wnDJpscRcsUJH72SaL5b31KXgiNrKtyCCyfBL/lh+0axGCgPneipMouCjIeXyjqAAd7ReFouiWf spFbFDvv3QL9/2NOlT3MCbafXuQpST8QEEVwHsa4eXPhEbrX/Ksb4V8adtWNZtW+N+J72bpycBo x8MfLUu3YqfMzhGrceqQHcBaYCnCHxKnQPzl9hBKPDlc5qbUqinYhKgm5k31EwtCGAeOBIVJPrk xOgVq0j78zraE0Ewz4mhblADNdZ0ehFYqsiwS0Fvs6P52WOGq7UwVBSdI= X-Received: by 2002:a05:6a00:1581:b0:81c:8d47:33ff with SMTP id d2e1a72fcca58-829a2f87d68mr4202468b3a.47.1772892489492; Sat, 07 Mar 2026 06:08:09 -0800 (PST) Received: from toolbx ([103.103.35.10]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-829a48ddd18sm4747313b3a.56.2026.03.07.06.07.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Mar 2026 06:08:09 -0800 (PST) From: Dorjoy Chowdhury To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-api@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 v5 1/4] openat2: new OPENAT2_REGULAR flag support Date: Sat, 7 Mar 2026 20:06:43 +0600 Message-ID: <20260307140726.70219-2-dorjoychy111@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260307140726.70219-1-dorjoychy111@gmail.com> References: <20260307140726.70219-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. EFTYPE is already used in BSD systems like FreeBSD, macOS. 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 | 6 ++++++ fs/namei.c | 4 ++++ fs/nfs/dir.c | 4 ++++ fs/open.c | 4 +++- fs/smb/client/dir.c | 14 +++++++++++++- 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, 63 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/ceph/file.c b/fs/ceph/file.c index 66bbf6d517a9..6d8d4c7765e6 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..4604e2e8a9cc 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -738,6 +738,12 @@ static int gfs2_create_inode(struct inode *dir, struct= dentry *dentry, inode =3D gfs2_dir_search(dir, &dentry->d_name, !S_ISREG(mode) || excl); error =3D PTR_ERR(inode); if (!IS_ERR(inode)) { + if (file && (file->f_flags & OPENAT2_REGULAR) && !S_ISREG(inode->i_mode)= ) { + iput(inode); + inode =3D NULL; + error =3D -EFTYPE; + goto fail_gunlock; + } if (S_ISDIR(inode->i_mode)) { iput(inode); inode =3D NULL; diff --git a/fs/namei.c b/fs/namei.c index 58f715f7657e..2a47289262bd 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 2402f57c8e7d..d8037c119317 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -2195,6 +2195,10 @@ int nfs_atomic_open(struct inode *dir, struct dentry= *dentry, break; case -EISDIR: case -ENOTDIR: + if (open_flags & OPENAT2_REGULAR) { + err =3D -EFTYPE; + break; + } goto no_open; case -ELOOP: if (!(open_flags & O_NOFOLLOW)) diff --git a/fs/open.c b/fs/open.c index 4f0a76dc8993..026b59af6124 100644 --- a/fs/open.c +++ b/fs/open.c @@ -1195,7 +1195,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; @@ -1234,6 +1234,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 953f1fee8cb8..355681ebacf1 100644 --- a/fs/smb/client/dir.c +++ b/fs/smb/client/dir.c @@ -222,6 +222,13 @@ static int cifs_do_create(struct inode *inode, struct = dentry *direntry, unsigned goto cifs_create_get_file_info; } =20 + if ((oflags & OPENAT2_REGULAR) && !S_ISREG(newinode->i_mode)) { + CIFSSMBClose(xid, tcon, fid->netfid); + iput(newinode); + rc =3D -EFTYPE; + goto out; + } + if (S_ISDIR(newinode->i_mode)) { CIFSSMBClose(xid, tcon, fid->netfid); iput(newinode); @@ -436,11 +443,16 @@ static int cifs_do_create(struct inode *inode, struct= dentry *direntry, unsigned goto out_err; } =20 - if (newinode) + if (newinode) { + if ((oflags & OPENAT2_REGULAR) && !S_ISREG(newinode->i_mode)) { + rc =3D -EFTYPE; + goto out_err; + } if (S_ISDIR(newinode->i_mode)) { rc =3D -EISDIR; goto out_err; } + } =20 d_drop(direntry); d_add(direntry, newinode); diff --git a/include/linux/fcntl.h b/include/linux/fcntl.h index d1bb87ff70e3..a6c692773af8 100644 --- a/include/linux/fcntl.h +++ b/include/linux/fcntl.h @@ -15,6 +15,8 @@ /* upper 32-bit flags (openat2(2) only) */ \ OPENAT2_EMPTY_PATH) =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 Thu Apr 9 14:58:08 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 DD3CD1C6FF5 for ; Sat, 7 Mar 2026 14:08:25 +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=1772892507; cv=none; b=uYqgDVgEwuHjXj6PRjn2i5xCrubU4zmY+dp4R1tPngpLjqTII9eSevQQHXIKC5aizHzMdDPtRrmU91t1YB9zd1g42VM0UNC2jnDcV5BwnwCZH49Gz+BeBuxCGf8sXviuw+Xxjp8t6l+bmBTwQrD01iHPi8RmVSFh80oWiLGLUHM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772892507; c=relaxed/simple; bh=QvKBTacd5z2P43CbYauz1u/x08KHhA7f2Nkz0BaL8og=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=auNqHAs5jAq8E0Y4gCPGrVi2xW9IxUNn9AHUjeb/FMVzamErd0DomL9DJQr7GIgrYlaFdiF+6h9NaQhX3jr71Nvm97+lLkdjgN1q9ug+m8sMSaZ+oHGEKRAXP08cN10IDLtBJs7eappDXy3iI4TZ5Abd6J2eCSfqDwLTYUbpFHw= 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=j//Nqssx; 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="j//Nqssx" Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-829a9c03780so1344055b3a.1 for ; Sat, 07 Mar 2026 06:08:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772892505; x=1773497305; 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=j//NqssxmhWBwW0YhQ6oRJKXQKgH7Mm5iRu1CkmB9uAJThjy7Ri+Hm5kgYVax8wgxU +UiSCPbRDYmh9msupkwRVd+MrCY3KmKJ878jDQZpUKiuXCsPJeRY7PuCigR1DNraTI5p z/WHvvdCakWKH7pHOzGnWAWuDlban3rOoSWXObOlZXonYOBQOka2Nh2H7H/LUaGJvDR0 9Bnm9J9A8yJGqN5yUcPhNskNZFnMQCuDaYUoXhhovrbijKW/LfR0WS40gyVoFsFoZihQ 68emMB2bbpGFUnPqT/U76/ZLZZdPJhB81OYDfiYC55dxiZ5FysUZjZVK7t2DEiQDjAsa 4DNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772892505; x=1773497305; 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=h3tOgz+jWXS7eDnxB40U8saYXRV+Rp2Y9zEKTM8QNFGEYN/+dtxDXpgSZVDDetjWVs Zb/wmTIBEkiY2LCcSfNYKKwxbvse8BTYV0ABNOUy8Abhxrvs/4JhHi3jQuY7Rggjovgf o4GNggCDasdWEUfpvQMLN0LxkxVX9pTIyebNp1Fz2tYUdNPLxDyG5pyOaTWrHa00jYz1 HkIx8YWfZ1FeVkYge+JGz8K5TuAkT6sWaNCYXLaff8yHzF5jttPohPZKl1BvPIeu+bXz Lv4IB+aCx1/CC47inCCjLJjTS2AUOOcQtn8IcuA6GY9zX+FskAbhqKOIHzXZe8XkIWGX GnSA== X-Gm-Message-State: AOJu0YwbLVCC1S8J+3+m3BJUc4Qn9e+XuZ+KXjF4XxHHWOijN7+TjDzT fvGO+Ulnxy7o2x2kAWQuK9NmSkSy3278a40rST9eiMCWuI0exo5dkYKK X-Gm-Gg: ATEYQzzek1GmvAYJl5PNRt5ulkXiypNYjqQi3b4p8H/JaUhW5WH/kF2Wo6MeVLS1ywP oKCeOEBZUOmdFlARfoCjnONZSlHUVsJRwjT/GufVedo2QfJMak8QZHdNrX95h3SabREiMfPuONC sA3KYveDQsKnLX4ccuhONtGSDsJ3Euxo1Uf0bJgQ0A+TtAEUyLnUWCvVXu4U06YYs1Wq1RjIq/u hTKWCwO6gJDiMYmO9KfKTMLJinf0eHgMUPBh29PSSXkylt+sGZTPcSdcWCoqRTJmLMjLfhMgNvQ jTcaqOaFN6iQb3jWbfIa2mjNmwqjQLQl3pkv4z6BTIwMH4pXybB8PMpd9AD+V1AWKzPfokWi7Fk vnEzl84en2TLpHMt3jhSx+dJ3RoBoncnmGwpXEeLhh7omOjii84ocq78xalpJmQT6flcaEapnTN LjkUAWzy7+/ltgzZS0N0fnR2l+iMymsYlbHYkxD4MhF3eTDx6s1vrr7U4= X-Received: by 2002:a05:6a00:1c87:b0:81e:d7c3:2f3a with SMTP id d2e1a72fcca58-829a2f5a754mr4767475b3a.46.1772892505338; Sat, 07 Mar 2026 06:08:25 -0800 (PST) Received: from toolbx ([103.103.35.10]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-829a48ddd18sm4747313b3a.56.2026.03.07.06.08.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Mar 2026 06:08:25 -0800 (PST) From: Dorjoy Chowdhury To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-api@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 v5 2/4] kselftest/openat2: test for OPENAT2_REGULAR flag Date: Sat, 7 Mar 2026 20:06:44 +0600 Message-ID: <20260307140726.70219-3-dorjoychy111@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260307140726.70219-1-dorjoychy111@gmail.com> References: <20260307140726.70219-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 Thu Apr 9 14:58:08 2026 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (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 E6CCA2DAFA5 for ; Sat, 7 Mar 2026 14:08:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772892524; cv=none; b=a4XgnO7AeAyipGOhB7K4AU0pZR+VUwSbbvb9f3Kdn8wm8okm+lfDIUYB9y97PktanlYov3jLtKkjzgqMPINnjtFu2RpTz7Ga8gOBtxPZmH9X+5vM725VMc/+f4QycKNWb6ZyD4MPkjouz4gjnu/580qHWmJyAlH2jknajFwz/eI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772892524; c=relaxed/simple; bh=Q9dm8LTnk+DFIEJAAB7tpFWixf8EizWYmak8EK7I1tg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DESjpAxHLuf4rTZN/57tCnLo5LBnawYVEHs2Pp+vKTZ2Xo0exmJSS3P8SMpeY4eDDKbY3CXPs9TOaLBHH13aNRfGjAncjSYBbMJSUf/LF+Zg2Ak7Pl8PGHaPWMFZlP4YmPJSUa7+imHXE8y7eutPKfgpr5JwHWLx+/5vahOvEec= 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=WyUET1vB; arc=none smtp.client-ip=209.85.210.179 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="WyUET1vB" Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-829a9c03780so1344165b3a.1 for ; Sat, 07 Mar 2026 06:08:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772892522; x=1773497322; 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=WyUET1vBFRbcwnM6O+g4qVx+Y3X8hs8yEO8XLxOATCDMFPD3E7aqYRG7yPmMI/DhRm wXC8k4D0hx6sE1gEAB3Ke9quwbR1R8885wbx+1sNGdE/RyaUR4VivxPegnACoMBt2L6J Ooupbr5SvS7eBZDnwcmf37bgCke0RSZt6yWeWX5d22CUjrv9EMDPxqho8ngBAhOwQox9 QjdtoPCN9MMrPufX1Cf64q81Tz4uT6O5R7L+eBvC5MFN3ySxr0MVu79Hc89nhN91tia+ UkH0cLlVvBgDFBfB2TZ3MrWhxbCdrPuQOabPsUtNnO5o05Jg10U5kqlHGEl00Z+p6Ila 78jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772892522; x=1773497322; 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=Y99wgUC0Bqs85YxW6e2nrGXC7aIY1znUiFRRtF8mwWIsOIZqS1YpsOc5kP2nVPL5Wg KhIxwIvzh0nNBdq0aQa1HrWFoHVpuRaz7bpUUmFMt+vKRaIUusYSCO2c0U9Uf46eFGcB HGoQ5Uz1yJRU9R+ypDK1IHNn104VEEfzgTo/Dwf87LZvyi6NNtww5M27jf6T1cR4WtAB uer8QmQEAn9KrKQ25z3ELeqoUnJrENiP0Nw2Oqr5DgqkCXs4ZLbyr0AzVf24uDZuvh+/ oEFRQi/HzENObgSCH05mqfLVBlL/yqpn42pBSxRAIyYJuxTUw3JU4l41eMmvDNpde7YP TMAA== X-Gm-Message-State: AOJu0YxlUv3uZvR+JwDF7efyIj//f1mMeUX16TtOuRa6qO+oTW6sn+lT 7ild3UKGCv/hbbx7tN5Ua0souILjN68lv4lXt2jEXED+lL6o0R3SzMLP X-Gm-Gg: ATEYQzxRwCOeJp7sbsLCqsixxnAEpwnHDbYOaFiBAcWvqtGdaXd/TZtk7XGUjty2fmo 8B+nIqw1HvlJGlt2JOW8+qJ0HYpj4AV4wub0qk8hMrIATlulIsrZNJBz91S6HGnkEkLKNpT8pp5 t8AVJuo3HcSY98AbP3DWp/1mJNloAIl83uFVB3uDOaLhAHFgaV1ByCmqWy3/4xfxrv9HEXqCbWs v3Is3SRklxAQFIit+NKrK4XZirCMi0hYXI+5PlmqIPausni4LD5M3cZD9BuDi8av3sNbBNwlsdP 2xWvGqOSfQRKKtpR/Ssa4JCu+rhx1Qbl2F3QC78dNklwW0CeBfklQB5ovFNwqzU2f4yJcXtSRVy D8NbJN/sccr2KJgLL1NCjFC2iLvvmprgNdKvf4zFZ159ByqF9wf1Tsg+O0OiaccAW9H8QXPP5kb g3M8ufZMaGq0V9nDyKTkdE4A6SiPxsOFZA6SYfGutNAZxyy5VHNXBmujs= X-Received: by 2002:a05:6a00:7586:b0:827:2a07:231d with SMTP id d2e1a72fcca58-829a2dbaa39mr4250553b3a.17.1772892522295; Sat, 07 Mar 2026 06:08:42 -0800 (PST) Received: from toolbx ([103.103.35.10]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-829a48ddd18sm4747313b3a.56.2026.03.07.06.08.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Mar 2026 06:08:42 -0800 (PST) From: Dorjoy Chowdhury To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-api@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 v5 3/4] sparc/fcntl.h: convert O_* flag macros from hex to octal Date: Sat, 7 Mar 2026 20:06:45 +0600 Message-ID: <20260307140726.70219-4-dorjoychy111@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260307140726.70219-1-dorjoychy111@gmail.com> References: <20260307140726.70219-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 Thu Apr 9 14:58:08 2026 Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (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 0D42B2DCC1C for ; Sat, 7 Mar 2026 14:08:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772892540; cv=none; b=VyDTqNf6eontsxQlIuEzmb1ProlPhUEsNqGUcArcSecRqAgV4QN5xFWc+cUacA4VxEei/uhau/3XqP5/aPGqDcrb2MqQr4HenIcQpmcZTQzhd4YBXPGJbdmylLAQ0n+Q6n5YYCKOwJTQQrkdLyCPy+LC3jizCCClhMwJPuUhSZc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772892540; c=relaxed/simple; bh=EKC+gjybz5QCo3/A2SoLkAdJ9dHzP8glwvLLU31BmCA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F+Gq394CNx+fqYDWW3Mx8ztrpVostCRLEnrv+lfk0A4kKIOdP/MX9ImT4dryjP/Gxsl5tsZsooPlHDXm+irfpbnbP91wb0+OT8D92uzTtRNxhKhMnq7W98rTZgkchwpCx6ihRdhWLBBmYK0aesfaUJEc3cYk8k9abk9C7FSLQzc= 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=Wb4wDDw+; arc=none smtp.client-ip=209.85.210.173 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="Wb4wDDw+" Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-8299f1ca894so992362b3a.2 for ; Sat, 07 Mar 2026 06:08:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772892538; x=1773497338; 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=Wb4wDDw+bHkQ4QFzd7CHYDyzuX9Cl9DuRHEoFHcFXRQBaG189KJfreVVIKpg0El3ca Yuse00bqCOE7lUV8ol5l8BttdYmXWtdgfInJa2s4lr7KWXKlPikHYp9gToDd23z/uFPX U+TjbjA09cEMI7QhrOSNztXQQVqWppg93HTKILs6u4qdZ5V720HMM9ubv/3AkShDxd9+ HRuqnQAn4xWwYR1PHOJdWmJCGECsOSGBGhYLHsia68y4sZd5DPJY4F2d+2aJsGGMLRsr F0HGQMF39Ct7hJv9fyZjDVmFUDKFQybmZJkVqkcXWPKPr5N6RY0roySeVDzrZld+y9WG fo4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772892538; x=1773497338; 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=A1TzwBjEShsWkkZWchSuSj+jso8a0hNcP0lKy2mlTqAdp6Y5euzJq0hAMwrhJYxQYw SdUUkprMY+8NZwgDXXGIMQkEBaSqPQu0ENCvzg6FLsRoI894AnT1VhlvFDkJ2PXjLARJ 9nCZRjt47RZDp3wvgQ0P78SErMMrLc+KRjQ34Fs63Uuh0qL5PJKnFbY+v1DqnuL7a4Co DMNIMnjwxJoMyqwM+DKNs2OK2RV+Hc1HFM9/GgfDmN/8SRe3Nxu9uobfNaufRH8m8rkj XiM1rMoClrsVvlDTJf+T5hw8Lxj+Qzj+eKqJAe4zGjOtsLAFBJX9CBLt2+bGrusiTAQu 7wcA== X-Gm-Message-State: AOJu0YzF9fAS7MwFRF2db3+QfD7/ywFFbGpJY3ike+Pfpkya3Y9fZWxJ EnVSe4vT208A335eizYbd1bd4M1mMAqOOzEMgOWLAk71O7rk3sc0k3mU X-Gm-Gg: ATEYQzxcreLrGp3DQitMqetzoDqdh0sf153i/oAZ+ZFmlL+lvLMX3b4DVWP6R9QDGKF XiGtOP1m53Hshm4Zy1hgowx4paKpjI1ygD37u52tp1/RAfgnmAbtASOQDn42+GiWi5IY9H0WkuN n65jEKnk9MpI29F4zylEq5a9q4Df+1HJR+cpUxE9ghAGzWkFQyVFNRk9/ojk8/sYjdHiZr/EdRy 66yM3QzHgTUKNgn1ll4tpUBpbOrgsq635EKKTXofXhT1ibKVOakCxB6A4KA767yG9GSz29x6VjS 2tUTeDXzeZhggMhH8vz9WKROmCcdHmCrXI+ynyNROshcPIqk0ObRKV46tJ1Ou3d0Nj8MKj7fQhU ptMZOV9dY++Gg5Jr0msJq4C6q1hB1/ZYLc4kTEQoT10QL1mq2kHtf+9bK558i9SAbmvvpcyJFIg t2+Dr3FylFEiCYadjvkpQCwUx4vo5qHxlVbzLU0sOCJVbMNpvkSLBD4uE= X-Received: by 2002:a05:6a21:700c:b0:366:14ac:e20a with SMTP id adf61e73a8af0-398591082a4mr5640721637.72.1772892538431; Sat, 07 Mar 2026 06:08:58 -0800 (PST) Received: from toolbx ([103.103.35.10]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-829a48ddd18sm4747313b3a.56.2026.03.07.06.08.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Mar 2026 06:08:58 -0800 (PST) From: Dorjoy Chowdhury To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-api@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 v5 4/4] mips/fcntl.h: convert O_* flag macros from hex to octal Date: Sat, 7 Mar 2026 20:06:46 +0600 Message-ID: <20260307140726.70219-5-dorjoychy111@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260307140726.70219-1-dorjoychy111@gmail.com> References: <20260307140726.70219-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