From: Roman Smirnov <r.smirnov@omp.ru>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>
Cc: Roman Smirnov <r.smirnov@omp.ru>,
Sergey Shtylyov <s.shtylyov@omp.ru>,
<linux-fsdevel@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<lvc-project@linuxtesting.org>
Subject: [PATCH] fs: buffer: set the expression type to unsigned long in folio_create_buffers()
Date: Tue, 16 Jul 2024 12:01:05 +0300 [thread overview]
Message-ID: <20240716090105.72179-1-r.smirnov@omp.ru> (raw)
Shift without specifying the type casts the expression to int,
which is then passed as an unsigned long argument. It is necessary
to use 1UL instead.
Found by Linux Verification Center (linuxtesting.org) with Svace.
Signed-off-by: Roman Smirnov <r.smirnov@omp.ru>
---
fs/buffer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/buffer.c b/fs/buffer.c
index 8c19e705b9c3..40dc18f1cba5 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -1782,7 +1782,7 @@ static struct buffer_head *folio_create_buffers(struct folio *folio,
bh = folio_buffers(folio);
if (!bh)
bh = create_empty_buffers(folio,
- 1 << READ_ONCE(inode->i_blkbits), b_state);
+ 1UL << READ_ONCE(inode->i_blkbits), b_state);
return bh;
}
--
2.34.1
next reply other threads:[~2024-07-16 9:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-16 9:01 Roman Smirnov [this message]
2024-07-16 15:41 ` Sergey Shtylyov
2024-07-16 15:51 ` Matthew Wilcox
2024-07-17 13:41 ` Jan Kara
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=20240716090105.72179-1-r.smirnov@omp.ru \
--to=r.smirnov@omp.ru \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=s.shtylyov@omp.ru \
--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
all inboxes | Powered by JetHome®