Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fs: fix incorrect fmode_t casts

Use __FMODE_NONOTIFY instead of FMODE_NONOTIFY to fixes
the following sparce warnings:
fs/overlayfs/file.c:48:37: sparse: warning: restricted fmode_t degrades to integer
fs/overlayfs/file.c:128:13: sparse: warning: restricted fmode_t degrades to integer
fs/open.c:1159:21: sparse: warning: restricted fmode_t degrades to integer

Signed-off-by: Min-Hua Chen <minhuadotchen@gmail.com>
Message-Id: <20230502232210.119063-1-minhuadotchen@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Min-Hua Chen and committed by
Christian Brauner
cedd0bdc 1168f095

+2 -2
+1 -1
fs/open.c
··· 1148 1148 inline int build_open_flags(const struct open_how *how, struct open_flags *op) 1149 1149 { 1150 1150 u64 flags = how->flags; 1151 - u64 strip = FMODE_NONOTIFY | O_CLOEXEC; 1151 + u64 strip = __FMODE_NONOTIFY | O_CLOEXEC; 1152 1152 int lookup_flags = 0; 1153 1153 int acc_mode = ACC_MODE(flags); 1154 1154
+1 -1
fs/overlayfs/file.c
··· 35 35 } 36 36 37 37 /* No atime modification nor notify on underlying */ 38 - #define OVL_OPEN_FLAGS (O_NOATIME | FMODE_NONOTIFY) 38 + #define OVL_OPEN_FLAGS (O_NOATIME | __FMODE_NONOTIFY) 39 39 40 40 static struct file *ovl_open_realfile(const struct file *file, 41 41 const struct path *realpath)