From nobody Sat Feb 7 08:02:08 2026 Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.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 C31AC2F5491 for ; Tue, 27 Jan 2026 18:01:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769536898; cv=none; b=XBN3ZJLNLhL8TEGnrMIrjYIflpBlnoj5Hmd9ezvywXOQiZgAhQVWIWUw6OLiW8aEJMP/cIR6/OXU9mXd3oqXrKtI6DpCc1hjT2Ph7fksbfxAmR66GPlIdQ0k3t7fpT4w8capEHC0KmSX0OHxYSrSpj62x14EM+QdFqFLU+zceEM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769536898; c=relaxed/simple; bh=s1VRtrN1rCxIrmB1bp08y4a8rJA3GT+7VXS+NY5X8Qo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Z3g1lB/+e/kLvuxJ04DTm2Vgc8bzVObRCPQQyZMg+m6mVSHDSy+ArqVnIgzvLVTWtIspVN2gaGRKOJ3/CUxeJdwKmcbWzJM4nUOivfGrZm+puR+TxNuLcva/edlWhPOy9U5GT0i1FRz+5v75Qht/D9heQHX23rb4xAQaea39ygo= 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=EKxy/k6a; arc=none smtp.client-ip=209.85.215.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="EKxy/k6a" Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-c62239decbeso2138314a12.2 for ; Tue, 27 Jan 2026 10:01:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769536896; x=1770141696; 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=npSZ8A74m3ybU6LKADRoribfE0dXr+fNAZsDs5EV4p4=; b=EKxy/k6a5Ili/VXblawiyA1fGANXCEk1p7FC5fIzeUqRoY8mIRyTokKTLIfR2j3fd1 i6WFTpORdDPryFL4FQTzuONfJDR8YX/5vOs0aHahczh7sveQD+F7/Cqk1p3yRcmJqvKK kPH+p53y4ZQJNLXDfKTs5gb4m8dZm2Wc5gvX+VvljhN3E0cwDilYnGHMg72maVlYu+U3 c/DQBliEppKweYvUu/5F87VbyCnCFws2qYVagfYb7+KCV8u4F3qw5LsJsr2Us2z+eG9a I0bUDYv7Mu5TWjU8uznF7ke6c+yCV5jfiqiMz5/ay3Xm3zjb7FDDoMMrFnBNRAT7RDwN NR3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769536896; x=1770141696; 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=npSZ8A74m3ybU6LKADRoribfE0dXr+fNAZsDs5EV4p4=; b=YSNNDY0tiFtqL8b3RZPq7P2CHMcAcy367zeUkBgWtFvJ1TKackLhrZoenaZoml9gOZ fFJmAPQKxM6lRmEXDWv5kgCgj/RPcZUnwreBvFOInO6byHwvYKODP/therYJsPkvsCXe 9u2fLOG/b/PI/v+3uuY6juueQ1LKyGL2M4oLg3VEGhSpqL6EH9kZu/RgDlgHxFKT4nu/ BwarHEVC1jJ0tebIQ19eM/tbrnDwJLOK8OJVpiupcC50EGngqFTAU0jmo2Gs0FVEQOXT R6+6vFzQioLr0cWhZOLtYTFDK9/a95bU5RZl2Qu7kOyRpekULpZ++sxqK4FMUOhgZLI9 CBcg== X-Gm-Message-State: AOJu0YzeVoa10WLZnvigO1C3t4M3byc87AsbCkYWlnUXSF4B4AIQUNP9 EbzkMPQJrjWOFDxGRi95Q6Xe9op576mTj3V+8BqbEczzx9G0+fw/0PRV X-Gm-Gg: AZuq6aI2uCxNggXQJcATOR8l9WWxDd/UA1vcna+FAlSBQy3Cw9FJGnEMJenXbhCPmZz XSrJA3vONRonJ6MrY7IEZTqtD8lvYs698kdHofZHur76kDoYAeulh8AfcfFLbqJJZI8Vpf1/ifj Z9ZkV77eoqCr2GVlcBjVJTeEk3XRBsy5HBG2XjnYuVMryKDBpBrht1+0F0KhC8LA7YSP0mL84nK BuZqZOTDfp0ZkcTqd2XjdA+JM+qvE7v4eutLqSOc9uSep68SGQ36WtnIzkpIRB4xKZyRPtMGPgj XMUfaKfLst2/+bg6TCjYppKMxXEU2/LcpD/74M7x5tNBxgiuvbiMsGQgxOUQzL/70hlAe6z1Dru s6pULFY/i8NgIccdyqsFPnNfd1UcK50Z4LUA1wdQx8zaU7AZb0bgdk58SZ89HaqUv9uKESjct3Q hWF18jnzcsaK1rGCC+kSjGwC7kZkwEyMiZJqP578/4wzjNifx8PkZvNg== X-Received: by 2002:a17:90b:270e:b0:34a:b459:bd10 with SMTP id 98e67ed59e1d1-353fed7104bmr2394940a91.24.1769536894069; Tue, 27 Jan 2026 10:01:34 -0800 (PST) Received: from toolbx ([103.230.182.3]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82379b1bc68sm216891b3a.2.2026.01.27.10.01.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jan 2026 10:01:33 -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 Subject: [PATCH v3 1/4] open: new O_REGULAR flag support Date: Tue, 27 Jan 2026 23:58:17 +0600 Message-ID: <20260127180109.66691-2-dorjoychy111@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260127180109.66691-1-dorjoychy111@gmail.com> References: <20260127180109.66691-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. A corresponding error code ENOTREG has been introduced. For example, if open is called on path /dev/null with O_REGULAR in the flag param, it will return -ENOTREG. 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, -ENOTREG is returned. -EINVAL is returned when O_REGULAR is combined with O_DIRECTORY (not part of O_TMPFILE) because it doesn't make sense to open a path that is both a directory and a regular file. 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/fcntl.c | 2 +- fs/namei.c | 6 ++++++ fs/open.c | 4 +++- 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 ++ 18 files changed, 38 insertions(+), 3 deletions(-) diff --git a/arch/alpha/include/uapi/asm/errno.h b/arch/alpha/include/uapi/= asm/errno.h index 6791f6508632..8bbcaa9024f9 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 ENOTREG 140 /* Not a regular file */ + #endif diff --git a/arch/alpha/include/uapi/asm/fcntl.h b/arch/alpha/include/uapi/= asm/fcntl.h index 50bdc8e8a271..4da5a64c23bd 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 O_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..293c78777254 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 ENOTREG 169 /* Not a regular file */ + #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..442917484f99 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 ENOTREG 258 /* Not a regular file */ + #endif diff --git a/arch/parisc/include/uapi/asm/fcntl.h b/arch/parisc/include/uap= i/asm/fcntl.h index 03dee816cb13..0cc3320fe326 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 O_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..8dce0bfeab74 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 ENOTREG 136 /* Not a regular file */ + #endif diff --git a/arch/sparc/include/uapi/asm/fcntl.h b/arch/sparc/include/uapi/= asm/fcntl.h index 67dae75e5274..a93d18d2c23e 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 O_REGULAR 0x4000000 =20 #define F_GETOWN 5 /* for sockets. */ #define F_SETOWN 6 /* for sockets. */ diff --git a/fs/fcntl.c b/fs/fcntl.c index f93dbca08435..62ab4ad2b6f5 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c @@ -1169,7 +1169,7 @@ static int __init fcntl_init(void) * Exceptions: O_NONBLOCK is a two bit define on parisc; O_NDELAY * is defined as O_NONBLOCK on some platforms and not on others. */ - BUILD_BUG_ON(20 - 1 /* for O_RDONLY being 0 */ !=3D + BUILD_BUG_ON(21 - 1 /* for O_RDONLY being 0 */ !=3D HWEIGHT32( (VALID_OPEN_FLAGS & ~(O_NONBLOCK | O_NDELAY)) | __FMODE_EXEC)); diff --git a/fs/namei.c b/fs/namei.c index b28ecb699f32..f5504ae4b03c 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -4616,6 +4616,10 @@ static int do_open(struct nameidata *nd, if (unlikely(error)) return error; } + + if ((open_flag & O_REGULAR) && !d_is_reg(nd->path.dentry)) + return -ENOTREG; + if ((nd->flags & LOOKUP_DIRECTORY) && !d_can_lookup(nd->path.dentry)) return -ENOTDIR; =20 @@ -4765,6 +4769,8 @@ static int do_o_path(struct nameidata *nd, unsigned f= lags, struct file *file) struct path path; int error =3D path_lookupat(nd, flags, &path); if (!error) { + if ((file->f_flags & O_REGULAR) && !d_is_reg(path.dentry)) + return -ENOTREG; audit_inode(nd->name, path.dentry, 0); error =3D vfs_open(&path, file); path_put(&path); diff --git a/fs/open.c b/fs/open.c index 74c4c1462b3e..82153e21907e 100644 --- a/fs/open.c +++ b/fs/open.c @@ -1173,7 +1173,7 @@ struct file *kernel_file_open(const struct path *path= , int flags, EXPORT_SYMBOL_GPL(kernel_file_open); =20 #define WILL_CREATE(flags) (flags & (O_CREAT | __O_TMPFILE)) -#define O_PATH_FLAGS (O_DIRECTORY | O_NOFOLLOW | O_PATH | O_CLOEXEC) +#define O_PATH_FLAGS (O_DIRECTORY | O_NOFOLLOW | O_PATH | O_CLOEXEC | O_R= EGULAR) =20 inline struct open_how build_open_how(int flags, umode_t mode) { @@ -1250,6 +1250,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 & O_REGULAR)) { + return -EINVAL; } if (flags & O_PATH) { /* O_PATH only permits certain other flags to be set. */ diff --git a/include/linux/fcntl.h b/include/linux/fcntl.h index a332e79b3207..4fd07b0e0a17 100644 --- a/include/linux/fcntl.h +++ b/include/linux/fcntl.h @@ -10,7 +10,7 @@ (O_RDONLY | O_WRONLY | O_RDWR | O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC | \ O_APPEND | O_NDELAY | O_NONBLOCK | __O_SYNC | O_DSYNC | \ FASYNC | O_DIRECT | O_LARGEFILE | O_DIRECTORY | O_NOFOLLOW | \ - O_NOATIME | O_CLOEXEC | O_PATH | __O_TMPFILE) + O_NOATIME | O_CLOEXEC | O_PATH | __O_TMPFILE | O_REGULAR) =20 /* List of all valid flags for the how->resolve argument: */ #define VALID_RESOLVE_FLAGS \ diff --git a/include/uapi/asm-generic/errno.h b/include/uapi/asm-generic/er= rno.h index 92e7ae493ee3..2216ab9aa32e 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 ENOTREG 134 /* Not a regular file */ + #endif diff --git a/include/uapi/asm-generic/fcntl.h b/include/uapi/asm-generic/fc= ntl.h index 613475285643..3468b352a575 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 O_REGULAR +#define O_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..8bbcaa9024f9 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 ENOTREG 140 /* Not a regular file */ + #endif diff --git a/tools/arch/mips/include/uapi/asm/errno.h b/tools/arch/mips/inc= lude/uapi/asm/errno.h index c01ed91b1ef4..293c78777254 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 ENOTREG 169 /* Not a regular file */ + #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..442917484f99 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 ENOTREG 258 /* Not a regular file */ + #endif diff --git a/tools/arch/sparc/include/uapi/asm/errno.h b/tools/arch/sparc/i= nclude/uapi/asm/errno.h index 4a41e7835fd5..8dce0bfeab74 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 ENOTREG 136 /* Not a regular file */ + #endif diff --git a/tools/include/uapi/asm-generic/errno.h b/tools/include/uapi/as= m-generic/errno.h index 92e7ae493ee3..2216ab9aa32e 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 ENOTREG 134 /* Not a regular file */ + #endif --=20 2.52.0 From nobody Sat Feb 7 08:02:08 2026 Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (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 285AB322B80 for ; Tue, 27 Jan 2026 18:01:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769536902; cv=none; b=YXe3gAQgF5ZqA14O6qM6o5jCFjUvvT8MoVakOCrTw/9F6raA3zVS/7SONQIswV3SKGyoyaqG7G1bqG0EkzEg9bSbxfuRexgLqh0k/2XHF6v+ThvZ4NFXpd16HVZ3KeSgSUuy/mqbkQU5s3Jx46nBD0pcRBkZPiUfrBk7COt+pOk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769536902; c=relaxed/simple; bh=tqewIhbRqq1adswiVbpduoDW8JX3z3VKvL2i1Kqr57I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bjy31vjhzrgycx1+CfTo0e06nZEtO25rQ9Sf20zknkKs3WFPT4LhmQMUZL8sj1c8FTmFxnZJF/cS3g+MZ3AKRWPGF8+GGvIp0hsxLy6EcHUlcRL55/uCH6XoTV55HBkoCHGUEJ3YVJpehb9j5A4BzfDkz8k7z213Qu87CnRTJQs= 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=aTn+fq/F; arc=none smtp.client-ip=209.85.210.182 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="aTn+fq/F" Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-823210d1d8eso2192255b3a.1 for ; Tue, 27 Jan 2026 10:01:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769536900; x=1770141700; 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=EFHTE7+4vut1ZBbXi2BaQWFLCQQCwb8j1cvQskcZkjo=; b=aTn+fq/FqyTDZaAEDHf07XjggDCP2frppyiTKRswruXN3rDTOoiYbfOIWrN6FmB77r ymX7yfMGFdwxelUU/kWB1LlOsb23wF+S84fb3X3XDSwLpHlgZ0XEzjOdJj2kV1qzehD7 12/B15D/TYWpzjL3lrKEojiyhDxBRF/Wlr3RV/NJYClZY7UyH/ZH0n48ahygJfqbT7O3 mSZZ25Aeom+XyYNiPBhaKSu15yeRectAzcbOyJR2XMq9+T0StSNAPcw/5ZivZ7ycb540 NfzJtvgucySpiRx2Y+CUPokk66VCytgNMiBC8P651EbsXO+iKr+9jb7ZB0gkf/Las8p6 5nSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769536900; x=1770141700; 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=EFHTE7+4vut1ZBbXi2BaQWFLCQQCwb8j1cvQskcZkjo=; b=srrPyjGIFY4s8rzDGxK29Nb/axsbsnzFP08XInnQjXl+/cBHsRfiL5tpr4BqRtcgxe lK4SSHOpyRmVRQGrV4yM+wTWnfLFf2Kjq/dnJuyy7ddTWl5oVI/8hpr39LNq6ErZUjP+ OxyKutLythporhN7DEhpy98XcpznMAoLEwO8B2ufZeW02KLBImHc6rtkBrmsUj3M8nJw 7c69pRzg7MB48kSYiIYy6FSVFanacfgHNvkhgJZmyEvlz2HOZZxqG0sNgQXf5tIi8ASB e4vwP66BOYHbSnUhI4Vk+4taxCrBFIFAlkc3cEjIJr5znNqQQ3xO9VmA1ZoI9T+PFKXb B0Xw== X-Gm-Message-State: AOJu0YwRDnqeteUJXo5mPrh9FKsTbC5KduTceLCC6FFPijXbWJVAHDLC +5xvdJdk0OvacIn2oEyjk2OwO1lKH2GPYB9nNvpQv6v/RNkPDMgLkuP4 X-Gm-Gg: AZuq6aJdqHUZhWvh57r11Fr0WfWQzRt8XVbpdYukBlm0SyqEA55AOA5jtvYWovzAjtM blAhlAlT4NszvUiOSfBr2yHyAWuz0ay7YpZTtNuKDJrw/Bj4WhXsIjCB85bKUox04pK2LGz1HlK 2OvuxKewmvBzL0QZpWI1tBhV204N9Xg7E5Nh/LRGdttf5X438SqgRpeuCc4V7GIY9X5rncXWo7Y rSaSrVEjQCQwy9H16M9J3tguYlmknI4qEVM1vM4iXl/zKe+3Z4obAjxJkav16O4zDbJqpXGc/IM Fw46i4KBcf1pwFe63NxkkOgoiu/Qwdi0dUsSUN8DuQb1NTsljm0Tnk6TAET2wjMRAJiZnbPIpwh 9zmkLqFDxgPl9a3msdSGiH0DyOqO+b7iG98K2Th7uMa+eCU+ySq1olPn68DnbAuTuKOXhzO7Mif an7eRaNLi7tY62F/hsxgg2OdJQW3xwgO+DbsZfAtT1vXJ/FhalB08e1g== X-Received: by 2002:a05:6a00:3e18:b0:823:d58:c48f with SMTP id d2e1a72fcca58-823692f0703mr2287212b3a.69.1769536900305; Tue, 27 Jan 2026 10:01:40 -0800 (PST) Received: from toolbx ([103.230.182.3]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82379b1bc68sm216891b3a.2.2026.01.27.10.01.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jan 2026 10:01:39 -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 Subject: [PATCH v3 2/4] kselftest/openat2: test for O_REGULAR flag Date: Tue, 27 Jan 2026 23:58:18 +0600 Message-ID: <20260127180109.66691-3-dorjoychy111@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260127180109.66691-1-dorjoychy111@gmail.com> References: <20260127180109.66691-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..011ebc9af4e5 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 O_REGULAR +#define O_REGULAR 040000000 +#endif + +#ifndef ENOTREG +#define ENOTREG 134 +#endif + +void test_openat2_o_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 O_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 -ENOTREG) { + ksft_test_result_fail("openat2 should return ENOTREG\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_o_regular_flag(); =20 if (ksft_get_fail_cnt() + ksft_get_error_cnt() > 0) ksft_exit_fail(); --=20 2.52.0 From nobody Sat Feb 7 08:02: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 9A8A82DB7B8 for ; Tue, 27 Jan 2026 18:01:45 +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=1769536906; cv=none; b=SG7Fk3FOe6JBOlXRrANktcNSAKQ4la9rRfebjfz5e0i6y8oHtfCLanyPXS2+sPnZZH1XXfJPk//LUZT9xJMwo2IdAA3WYTh314uLI7xRsFQiqQgUmEo9+NiHPICG0zp5tivBXxLixhJf2WjKmRzfXy18vQaR0zJ4XHib0XBrcv0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769536906; c=relaxed/simple; bh=fGlXttV7nMmxi4UcuYtsCWFX6BEZWzCp9QY5mD62bk4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S17vgPVqp20l36N8xV8S2njBlCa3aW+xxBOYbmXxqZSfM5E1Qi+hduu4VySe8PgNEdj8sxFaFd6Ch+rB9akSVZ1/Qgfh4ovqiwXJLfHYdOCwe+VKU6X9gtiblQyuep/+3j13RHDuOyANa55HRzHdh8ytoD0r2vXM3Gi4ZCq8E9o= 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=FdmUOdvz; 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="FdmUOdvz" Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-823081bb15fso3289261b3a.3 for ; Tue, 27 Jan 2026 10:01:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769536905; x=1770141705; 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=fmJz7Q237YfPvUh8bIWiB/H6qzUCS1WcnX3PPdkuOR4=; b=FdmUOdvziWp418HeEvFVfEzMTpkFxR2S+LIgRIphNYI3rZI8Sd3S2+vgG6kzwnxi36 I+x4lapqbn7+b8uUZ3jv+RleIdr4eZnQwMVBJPsS3nL3ja05nRRQosQSvooL9b2inxsd oRhIlgYQFnjczvsHGOCf9tPjPtz1Ap/cmD+xXgcCLvWnmdaflJj9snsuYUc7iEjp2sZk UfekmT8aQvPy+R2yhEjqh9PhFXTPBtVlu9JMoTmOaiO2vkWuUzO+jjkBeEMV4p3LraH2 cAgQRR20BrZXIRUq6ggZbKx6l3I7h7vxdoCR+kGgCpqYcp90L7Mt8lU6mCKm7v9QFOjq qlFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769536905; x=1770141705; 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=fmJz7Q237YfPvUh8bIWiB/H6qzUCS1WcnX3PPdkuOR4=; b=GY4n0aFUahr3wBasiJEY2pn1L6ARhpQxTqJ8r7b8e+r3iJ2pPjHZePCMNPAJipqxAr eQuMWHmfWPdt4qS7tTP9e3D9N3L4lJRWvuem7AgytoHIebkKjv4ujdveHAWgmok59gyq u9thA7Afd64taYn6pU8PZxyOntvIsNLLF/UAvHxB1LMyLY4b8KKMAVKeCdPC74cSkfFr V5IkNz91FJ8V77u3E0XqSjQdY74oPgmcJ8ZOm12EFHDv15YhaWgPcppTzT4s81JMkDtx kIUuThUuouyFZj2vJtwmStNbuL8UHPfKZULOE+FiAfwvzR5eDx0hCAMgefjJ9V13wwOv k+ag== X-Gm-Message-State: AOJu0YwNQcpchr23h+7uJzmKjh+cNipBOoVOhwilKdmeiByVRkcxpmLY UJiQkzUplsq5gb8NQ0IX5aVXH0Nmo076AbB0uHJk++KpmIqMfNQeFO8v X-Gm-Gg: AZuq6aJSCXtP8anLa6gUh0jkxzbSwJ7fnUdIMMejd0DK/aVeSSCc2KiVlmU+Kyn7MFH yIQZ/gwmYoFqIoZIXDsi5Rs2RQ3zUlzICCmVolWzDsatV+87EkdmS73Az6yVn0pRpX9oH7XVsyj 4v5rI0vQ/wWZ3y/+fV1w0dU37quHWNy4AoJROtbkPmkhqJUkby2musgRuN8lfB4MWBZ12bcARry /nCx2j0cyNJwPnIYlMapOFqcUQtmK3JO/5XlLGAGVfYPJT7q9JKQgoO1DsY3Sz4o/V9vbRxVOD2 08FsOrNjfmFbB1MNOhRkBb4kntBCggAQYXNg9+EL7Y1PDcuboSXWDNWgLQaEvRKD4hcVlAD4DKT R0+V32VF383vapo1rujlzgHY4sAlYDs+NxfGSpW2Uemf0LxDspsS8nHZsiUfIQ4Sz2CsQnpSjRc Bla+owDaEeIm2+5m3zd5s1NbOLDkWUsVAoB/Hf4NL8odI= X-Received: by 2002:a05:6a00:bc83:b0:81f:4675:c2a5 with SMTP id d2e1a72fcca58-8236928e24dmr2648269b3a.32.1769536904802; Tue, 27 Jan 2026 10:01:44 -0800 (PST) Received: from toolbx ([103.230.182.3]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82379b1bc68sm216891b3a.2.2026.01.27.10.01.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jan 2026 10:01:44 -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 Subject: [PATCH v3 3/4] sparc/fcntl.h: convert O_* flag macros from hex to octal Date: Tue, 27 Jan 2026 23:58:19 +0600 Message-ID: <20260127180109.66691-4-dorjoychy111@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260127180109.66691-1-dorjoychy111@gmail.com> References: <20260127180109.66691-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 a93d18d2c23e..3c16f1a66a6a 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 O_REGULAR 0x4000000 +#define O_PATH 0100000000 +#define __O_TMPFILE 0200000000 +#define O_REGULAR 0400000000 =20 #define F_GETOWN 5 /* for sockets. */ #define F_SETOWN 6 /* for sockets. */ --=20 2.52.0 From nobody Sat Feb 7 08:02:08 2026 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (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 6CA732DB7B8 for ; Tue, 27 Jan 2026 18:01:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769536911; cv=none; b=P9OPq1oXWD+PaM0G5sRxr7hPU3kdlTT6CfsGBUe3K8gdC0LxV908HtCMbVn7Mqx9icCp+SVaddaiF1nbIX5cztsbrQwT8Fwmt+6X+pH/Nzhzak9dYYdwkKja7u8VO8r7ZxAhp+/7cLtG0LO+N0kPDkfXVQB9M0CvPaMimUdF1d4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769536911; c=relaxed/simple; bh=eEVLpo0/xWWCNyXB2qN7+LU2JrOD+X8cK85rNuw9cR4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T6+7ienC67a3/GWznhQW5H0PKKFxkHFol0pIEMbsJgH0VwqCQkta1GP5ksGyyAiLaVr7YPLRmR4VbFv6NtfdbYTx9B2UUdE5sgRThqZDk1m4YhFRaFc5vGaZC1yjOUy1NlQm7aG5XvT0Q7D7B48VzzSQ2HptwrG53Nrqa1ptko8= 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=P/MzFsHH; arc=none smtp.client-ip=209.85.210.169 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="P/MzFsHH" Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-82310b74496so2772258b3a.3 for ; Tue, 27 Jan 2026 10:01:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769536910; x=1770141710; 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=xKA6NqBZUbRPPOHudTEbZyIDBpxMfrFTaNpZfF3CE7Q=; b=P/MzFsHHqreK0DAFO//Y9yrBBaff1a1H8bbh+BHLayw9RDEEoylv5ID+uCl7G9AkCn WYcHtUZE4tLI6JfxzwvaM7V+Au/rLfKFGTXqviTW2hew83KxOJM2t6aUW9Ev6Ovs+oF3 Iot9bQDVpDa61AhraTXpoqklFT7+iodH8WIxiyTd4Z8QIVNy88UEsH9GTOXwYu/AmHyM 8mOkGDLEY+hrvBkJWGV2DtwspEx1vM8SN7MGIO2WDPPyC/2LkEqNFeE1aXutroa1YbzZ 0w4408c3FlcY7l1KeMYJ726cIFr9aj9wMenuEQRSnvVuYE4C3SYcUm++zmGmjmk5vBZB tL+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769536910; x=1770141710; 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=xKA6NqBZUbRPPOHudTEbZyIDBpxMfrFTaNpZfF3CE7Q=; b=ssV4JtK0z16GvDcjCzEZrF4UttaEbL41DdPNAcvebrhkOx4CQ2sY4q0WDB+vgc0trL gwhRRBdz6Us3KN6LIo2tg3WIpr7OKrfQASn/DO2F+H3aaVjW8rLgjif3FXYOnVEHRn5H 3dQTJTRDMdKj8BzvBSexT4KMrbC0dA1qEGTfYqXXu/MS4TFFt5AHuoVRBiC4+Z8qF8iU qAngZBe9E87mA97xrfl7YRUUyzTLbjuJene+5Sm4TrGnM40MJKWojAloH3ybzrdByz3q nmXTZU69Ickv9pnZbcOI9WAca2XF93PNBZ5XwAhcdfAgg6TMm8Aot//8lLtBncgNJmVZ GYxA== X-Gm-Message-State: AOJu0Yx8UG5CPTHIQMw4dAts/e0Tio24VwAv6srYPJUhEfEH30NPnr/M 6tql3sCyunEQo16ARQiSD74ilVrX7rddjiBfuqjBOU36aaXpUlSoPqLN X-Gm-Gg: AZuq6aJ+iSM4iS+zs4lGDLwS6YBnYA7tHwDtrnvMqPku7eLgcwUs9nxwA5JgCydIoQ6 h2/cmkSScJm0BfkAdYD6Dt8LmW4WRFNjRep1XNN5ZP5kx3szaB1fy7fr19xjnv16j4FZ8Xw9XLQ D8Cck/ACl4tdFwt124i3k3nBUU03V+RPiX77SNs/XDxDbMjut1ovyYW/7zat6UxRk9dz+D1f4ji AHPGGX0DjL6r+mqcOTU3IuphaRIq9GsqX7pW31YzDMhrDHBmjpwRVfolBAznXAYlaZ5P1FHgWnc QQnAF2rtlqCaWvoruAqNqByHKGywKTbHEO8KnW8XFHZJnhMeE3F5Opxcn1sjDm5c200apdz86DE it/pIeXx5mq2hIyM7n2Z+p48Zzq1cz5TU8l9+cVUITI2pJx5ezoEt/orjoNzcEZpUkp7VowsSnm Os/WGF2xEoyGJ/+/vPO97rpAuZYlQtmKcgxGw4fV+vO3E= X-Received: by 2002:a05:6a00:800d:b0:81f:3d13:e07b with SMTP id d2e1a72fcca58-823692a0fe5mr2211061b3a.43.1769536909590; Tue, 27 Jan 2026 10:01:49 -0800 (PST) Received: from toolbx ([103.230.182.3]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82379b1bc68sm216891b3a.2.2026.01.27.10.01.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jan 2026 10:01:49 -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 Subject: [PATCH v3 4/4] mips/fcntl.h: convert O_* flag macros from hex to octal Date: Tue, 27 Jan 2026 23:58:20 +0600 Message-ID: <20260127180109.66691-5-dorjoychy111@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260127180109.66691-1-dorjoychy111@gmail.com> References: <20260127180109.66691-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.52.0