linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vasily Averin <vvs@openvz.org>
To: linux-fsdevel@vger.kernel.org
Cc: kernel@openvz.org, linux-kernel@vger.kernel.org,
	Christoph Hellwig <hch@infradead.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Christian Brauner <brauner@kernel.org>
Subject: [PATCH v3] fs/open.c: fix incorrect fmode_t cast in build_open_how
Date: Sun, 22 May 2022 15:07:25 +0300	[thread overview]
Message-ID: <eeaba25e-7c79-3c46-c39e-a2352dbfe007@openvz.org> (raw)

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


             reply	other threads:[~2022-05-22 12:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-22 12:07 Vasily Averin [this message]
2022-05-22 12:08 ` [PATCH v3] fs/open.c: fix incorrect fmode_t cast in build_open_how Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eeaba25e-7c79-3c46-c39e-a2352dbfe007@openvz.org \
    --to=vvs@openvz.org \
    --cc=brauner@kernel.org \
    --cc=hch@infradead.org \
    --cc=kernel@openvz.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).