linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] fs/open.c: fix incorrect fmode_t cast in build_open_how
@ 2022-05-22 12:07 Vasily Averin
  2022-05-22 12:08 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Vasily Averin @ 2022-05-22 12:07 UTC (permalink / raw)
  To: linux-fsdevel
  Cc: kernel, linux-kernel, Christoph Hellwig, Alexander Viro,
	Christian Brauner

Fixes sparce warning:
fs/open.c:1024:21: sparse: warning: restricted fmode_t degrades to integer

FMODE_NONOTIFY have bitwise fmode_t type which requires __force for any
casts. Use __FMODE_NONTIFY instead.

Signed-off-by: Vasily Averin <vvs@openvz.org>
Acked-by: Jan Kara <jack@suse.cz>
Reviewed-by: Christian Brauner (Microsoft) <brauner@kernel.org>
---
v3: split, according to Christoph Hellwig recommendation
---
 fs/open.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/open.c b/fs/open.c
index 1315253e0247..386c52e4c3b1 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -1021,7 +1021,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);
 
-- 
2.36.1


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

* Re: [PATCH v3] fs/open.c: fix incorrect fmode_t cast in build_open_how
  2022-05-22 12:07 [PATCH v3] fs/open.c: fix incorrect fmode_t cast in build_open_how Vasily Averin
@ 2022-05-22 12:08 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2022-05-22 12:08 UTC (permalink / raw)
  To: Vasily Averin
  Cc: linux-fsdevel, kernel, linux-kernel, Christoph Hellwig,
	Alexander Viro, Christian Brauner

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

end of thread, other threads:[~2022-05-22 12:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-22 12:07 [PATCH v3] fs/open.c: fix incorrect fmode_t cast in build_open_how Vasily Averin
2022-05-22 12:08 ` Christoph Hellwig

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).