From: yangerkun <yangerkun@huawei.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: <mike.kravetz@oracle.com>, <linux-mm@kvack.org>,
<linux-fsdevel@vger.kernel.org>, <yukuai3@huawei.com>
Subject: Re: [PATCH] hugetlbfs: avoid overflow in hugetlbfs_fallocate
Date: Wed, 24 Nov 2021 14:05:23 +0800 [thread overview]
Message-ID: <3ad388a4-503d-6cbf-a02c-118594d36d33@huawei.com> (raw)
In-Reply-To: <YZ2+ecB1dDOdY+gp@casper.infradead.org>
On 2021/11/24 12:24, Matthew Wilcox wrote:
> On Wed, Nov 24, 2021 at 12:08:18PM +0800, yangerkun wrote:
>> start = offset >> hpage_shift;
>> - end = (offset + len + hpage_size - 1) >> hpage_shift;
>> + end = ((unsigned long long)offset + len + hpage_size - 1)
>> + >> hpage_shift;
>
> + end = DIV_ROUND_UP_ULL(offset + len, hpage_size);
Thanks, will do it in v2!
> .
>
prev parent reply other threads:[~2021-11-24 6:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-24 4:08 yangerkun
2021-11-24 4:24 ` Matthew Wilcox
2021-11-24 6:05 ` yangerkun [this message]
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=3ad388a4-503d-6cbf-a02c-118594d36d33@huawei.com \
--to=yangerkun@huawei.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mike.kravetz@oracle.com \
--cc=willy@infradead.org \
--cc=yukuai3@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox