Skip to content

Commit cedd0bd

Browse files
Min-Huabrauner
authored andcommitted
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>
1 parent 1168f09 commit cedd0bd

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

fs/open.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ inline struct open_how build_open_how(int flags, umode_t mode)
11481148
inline int build_open_flags(const struct open_how *how, struct open_flags *op)
11491149
{
11501150
u64 flags = how->flags;
1151-
u64 strip = FMODE_NONOTIFY | O_CLOEXEC;
1151+
u64 strip = __FMODE_NONOTIFY | O_CLOEXEC;
11521152
int lookup_flags = 0;
11531153
int acc_mode = ACC_MODE(flags);
11541154

fs/overlayfs/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static char ovl_whatisit(struct inode *inode, struct inode *realinode)
3535
}
3636

3737
/* 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)
3939

4040
static struct file *ovl_open_realfile(const struct file *file,
4141
const struct path *realpath)

0 commit comments

Comments
 (0)