From: Alex Elder <elder@inktank.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: ceph-devel@vger.kernel.org
Subject: Re: [PATCH] ceph: avoid 32-bit page index overflow
Date: Tue, 02 Oct 2012 14:21:03 -0500 [thread overview]
Message-ID: <506B3E9F.3060006@inktank.com> (raw)
In-Reply-To: <20121002163225.GA26594@infradead.org>
On 10/02/2012 11:32 AM, Christoph Hellwig wrote:
> On Tue, Oct 02, 2012 at 10:28:24AM -0500, Alex Elder wrote:
>> A pgoff_t is defined (by default) to have type (unsigned long). On
>> architectures such as i686 that's a 32-bit type. The ceph address
>> space code was attempting to produce 64 bit offsets by shifting a
>> page's index by PAGE_CACHE_SHIFT, but the result was not what was
>> desired because the shift occurred before the result got promoted
>> to 64 bits.
>>
>> Fix this by casting all uses of page->index used in this way to
>> the desired 64-bit type.
>
> It would be cleaner if you'd use the page_offset helper, which was
> added to fix this problem without having to remember the right casts
> everywhere.
Will do. Thanks Christoph.
-Alex
prev parent reply other threads:[~2012-10-02 19:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-02 15:28 [PATCH] ceph: avoid 32-bit page index overflow Alex Elder
2012-10-02 16:20 ` Sage Weil
2012-10-02 16:32 ` Christoph Hellwig
2012-10-02 19:21 ` Alex Elder [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=506B3E9F.3060006@inktank.com \
--to=elder@inktank.com \
--cc=ceph-devel@vger.kernel.org \
--cc=hch@infradead.org \
/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.