From: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
To: Andreas Dilger <adilger@clusterfs.com>
Cc: Johann Lombardi <johann.lombardi@bull.net>,
Kalpak Shah <kalpak@clusterfs.com>,
linux-ext4 <linux-ext4@vger.kernel.org>, tytso <tytso@mit.edu>,
sct <sct@redhat.com>
Subject: Re: [RFC] [PATCH 1/1] Nanosecond timestamps
Date: Wed, 07 Feb 2007 15:05:39 -0600 [thread overview]
Message-ID: <1170882340.13329.4.camel@kleikamp.austin.ibm.com> (raw)
In-Reply-To: <20070207203946.GB6565@schatzie.adilger.int>
On Wed, 2007-02-07 at 13:39 -0700, Andreas Dilger wrote:
> On Feb 06, 2007 16:12 +0100, Johann Lombardi wrote:
> > > + if (EXT3_SB(sb)->s_want_extra_isize <
> > > + le32_to_cpu(es->s_min_extra_isize))
> > ^^
> > > + EXT3_SB(sb)->s_want_extra_isize =
> > > + le32_to_cpu(es->s_min_extra_isize);
> > ^^
> > Since es->s_{min,want}_extra_isize are both __u16 (BTW, shouldn't it be
> > __le16?), I think you should use le16_to_cpu() instead of le32_to_cpu().
>
> You are right - this works fine on little endian systems, but fails on
> big endian systems where you will get the other half of the word.
>
> This has been a bug in several places already, and I wonder if the
> le*_to_cpu() and cpu_to_le*() macros shouldn't do some type checking
> instead of just casting the variable to the specified type?
I think that sparse will catch this. To get the endian checks you need
to do something like this:
make C=2 CF="-D__CHECK_ENDIAN__"'
--
David Kleikamp
IBM Linux Technology Center
next prev parent reply other threads:[~2007-02-07 21:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-02 14:49 [RFC] [PATCH 1/1] Nanosecond timestamps Kalpak Shah
2007-02-06 15:12 ` Johann Lombardi
2007-02-07 20:39 ` Andreas Dilger
2007-02-07 21:05 ` Dave Kleikamp [this message]
2007-02-08 10:33 ` Johann Lombardi
2007-02-08 10:30 ` Johann Lombardi
2007-02-13 13:16 ` [PATCH Take2 " Kalpak Shah
2007-02-19 9:56 ` Johann Lombardi
2007-02-07 20:50 ` [RFC] [PATCH " Johann Lombardi
-- strict thread matches above, loose matches on Subject: below --
2007-02-02 14:39 [RFC] [PATCH 1/1] nanosecond timestamps Kalpak Shah
2007-02-06 4:09 ` Theodore Tso
2007-02-07 17:58 ` Andreas Dilger
2007-02-15 17:51 ` Theodore Tso
2007-02-25 10:36 ` Andrew Morton
2007-02-26 21:42 ` Andreas Dilger
2007-02-26 23:20 ` Dave Kleikamp
2007-02-27 0:11 ` Andreas Dilger
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=1170882340.13329.4.camel@kleikamp.austin.ibm.com \
--to=shaggy@linux.vnet.ibm.com \
--cc=adilger@clusterfs.com \
--cc=johann.lombardi@bull.net \
--cc=kalpak@clusterfs.com \
--cc=linux-ext4@vger.kernel.org \
--cc=sct@redhat.com \
--cc=tytso@mit.edu \
/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;
as well as URLs for NNTP newsgroup(s).