linux-unionfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs: fix incorrect fmode_t casts
@ 2023-05-02 23:22 Min-Hua Chen
  2023-05-15 11:17 ` Christian Brauner
  0 siblings, 1 reply; 2+ messages in thread
From: Min-Hua Chen @ 2023-05-02 23:22 UTC (permalink / raw)
  To: Alexander Viro, Christian Brauner, Miklos Szeredi
  Cc: Min-Hua Chen, linux-fsdevel, linux-kernel, linux-unionfs

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>
---
 fs/open.c           | 2 +-
 fs/overlayfs/file.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/open.c b/fs/open.c
index 4478adcc4f3a..9d5edcedcbb7 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -1156,7 +1156,7 @@ inline struct open_how build_open_how(int flags, umode_t mode)
 inline int build_open_flags(const struct open_how *how, struct open_flags *op)
 {
 	u64 flags = how->flags;
-	u64 strip = FMODE_NONOTIFY | O_CLOEXEC;
+	u64 strip = __FMODE_NONOTIFY | O_CLOEXEC;
 	int lookup_flags = 0;
 	int acc_mode = ACC_MODE(flags);
 
diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c
index 7c04f033aadd..0801917f932e 100644
--- a/fs/overlayfs/file.c
+++ b/fs/overlayfs/file.c
@@ -35,7 +35,7 @@ static char ovl_whatisit(struct inode *inode, struct inode *realinode)
 }
 
 /* No atime modification nor notify on underlying */
-#define OVL_OPEN_FLAGS (O_NOATIME | FMODE_NONOTIFY)
+#define OVL_OPEN_FLAGS (O_NOATIME | __FMODE_NONOTIFY)
 
 static struct file *ovl_open_realfile(const struct file *file,
 				      const struct path *realpath)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fs: fix incorrect fmode_t casts
  2023-05-02 23:22 [PATCH] fs: fix incorrect fmode_t casts Min-Hua Chen
@ 2023-05-15 11:17 ` Christian Brauner
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Brauner @ 2023-05-15 11:17 UTC (permalink / raw)
  To: Min-Hua Chen
  Cc: Christian Brauner, linux-fsdevel, linux-kernel, linux-unionfs,
	Alexander Viro, Miklos Szeredi

On Wed, 03 May 2023 07:22:08 +0800, Min-Hua Chen wrote:
> 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
> 
> 
> [...]

Applied to the vfs.misc branch of the vfs/vfs.git tree.
Patches in the vfs.misc branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.misc

[1/1] fs: fix incorrect fmode_t casts
      https://git.kernel.org/vfs/vfs/c/079ad16ded46

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-15 11:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-02 23:22 [PATCH] fs: fix incorrect fmode_t casts Min-Hua Chen
2023-05-15 11:17 ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).