From: Christoph Hellwig <hch@infradead.org>
To: Eric Biggers <ebiggers@kernel.org>
Cc: Yongpeng Yang <yangyongpeng.storage@gmail.com>,
Jaegeuk Kim <jaegeuk@kernel.org>, Theodore Ts'o <tytso@mit.edu>,
linux-fscrypt@vger.kernel.org,
Yongpeng Yang <yangyongpeng@xiaomi.com>,
linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org,
Luis Chamberlain <mcgrof@kernel.org>
Subject: Re: [PATCH v2] fscrypt: fix left shift underflow when inode->i_blkbits > PAGE_SHIFT
Date: Tue, 4 Nov 2025 03:12:53 -0800 [thread overview]
Message-ID: <aQnftXAg93-4FbaO@infradead.org> (raw)
In-Reply-To: <20251103164829.GC1735@sol>
On Mon, Nov 03, 2025 at 08:48:29AM -0800, Eric Biggers wrote:
> > *inode_ret = inode;
> > - *lblk_num_ret = ((u64)folio->index << (PAGE_SHIFT - inode->i_blkbits)) +
> > + *lblk_num_ret = (((u64)folio->index << PAGE_SHIFT) >> inode->i_blkbits) +
This should be using folio_pos() instead of open coding the arithmetics.
next prev parent reply other threads:[~2025-11-04 11:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-30 7:29 [PATCH v2] fscrypt: fix left shift underflow when inode->i_blkbits > PAGE_SHIFT Yongpeng Yang
2025-11-03 16:48 ` Eric Biggers
2025-11-04 11:12 ` Christoph Hellwig [this message]
2025-11-04 15:05 ` Yongpeng Yang
2025-11-05 13:38 ` Christoph Hellwig
2025-11-04 18:10 ` Eric Biggers
2025-11-05 13:40 ` 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=aQnftXAg93-4FbaO@infradead.org \
--to=hch@infradead.org \
--cc=ebiggers@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-fscrypt@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=tytso@mit.edu \
--cc=yangyongpeng.storage@gmail.com \
--cc=yangyongpeng@xiaomi.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.