From: Willy Tarreau <w@1wt.eu>
To: "Jurzitza, Dieter" <DJurzitza@harmanbecker.com>
Cc: linux-kernel@vger.kernel.org, Jeff Mahoney <jeffm@suse.com>,
sparclinux@vger.kernel.org, davem@davemloft.net, aeb@cwi.nl
Subject: Re: fix 2.4.33.3 / sun partition size
Date: Sat, 16 Sep 2006 23:33:56 +0200 [thread overview]
Message-ID: <20060916213356.GA1420@1wt.eu> (raw)
In-Reply-To: <DA6197CAE190A847B662079EF7631C06015692C6@OEKAW2EXVS03.hbi.ad.harman.com>
[Andries CCed since he's the partition maintainer]
Hi Dieter,
On Wed, Sep 13, 2006 at 07:40:26AM +0200, Jurzitza, Dieter wrote:
> Dear Willy,
> one final thougth here: ist there any real reason to *not* make
> add_gd_partition (struct gendisk, int minor, unsigned long start, unsigned long size){...}
> (see fs/partitions/check.c)
> as:
>
> - within add_gd_partition the two values start and size are assigned to a field of type unsigned long,
> - we both agree that there is no reason to use signed ints in this case,
> - any byte size conversion issue would be covered by the fact that it does not hurt assigning too small numbers to oversized ones.
>
> Just my two cents here ...
I agree with your analysis here. I've checked the code right now, and using signed
ints in add_gd_partition() makes no sense to me as the hd_struct uses unsigned longs.
So a cast is performed within add_gd_partition() anyway.
We should make add_gd_partition() accept unsigned longs so that only its users will
have to cast to unsigned long if needed, and this way it will be easier to track
invalid signedness use.
I've quickly checked if 2.6 needs a fix, but 2.6 declares add_partition() with
sector_t values which are unsigned longs. So 2.6 is safe right now. I will add
the fix and check at least on x86 and sparc64 that I do not see any regression
nor warnings (I don't have 1TB to check larger partitions!).
Thanks,
Willy
next prev parent reply other threads:[~2006-09-16 22:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-13 5:40 AW: fix 2.4.33.3 / sun partition size Jurzitza, Dieter
2006-09-16 21:33 ` Willy Tarreau [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-09-12 11:23 Jurzitza, Dieter
2006-09-12 19:17 ` Willy Tarreau
2006-09-12 22:17 ` Tom 'spot' Callaway
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=20060916213356.GA1420@1wt.eu \
--to=w@1wt.eu \
--cc=DJurzitza@harmanbecker.com \
--cc=aeb@cwi.nl \
--cc=davem@davemloft.net \
--cc=jeffm@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sparclinux@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox