From: Paul Clements <paul.clements@steeleye.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: Neil Brown <neilb@suse.de>, linux-raid@vger.kernel.org
Subject: Re: [BUG/PATCH] md bitmap broken on big endian machines
Date: Thu, 28 Sep 2006 20:48:36 -0400 [thread overview]
Message-ID: <451C6D64.5050807@steeleye.com> (raw)
In-Reply-To: <451C4814.9030601@tls.msk.ru>
Michael Tokarev wrote:
> Neil Brown wrote:
>> ffs is closer, but takes an 'int' and we have a 'unsigned long'.
>> So use ffz(~X) to convert a chunksize into a chunkshift.
>
> So we don't use ffs(int) for an unsigned value because of int vs
> unsigned int, but we use ffz() with negated UNSIGNED. Looks even
> more broken to me, even if it happens to work correctly... ;)
No, it doesn't matter about the signedness, these are just bit
operations. The problem is the size (int vs. long), even though in
practice it's very unlikely you'd ever have a bitmap chunk size that
exceeded 32 bits. But it's better to be correct and not have to worry
about it.
--
Paul
next prev parent reply other threads:[~2006-09-29 0:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-21 20:26 [BUG/PATCH] md bitmap broken on big endian machines Paul Clements
2006-09-22 15:29 ` [PATCH] md SET_BITMAP_FILE compat ioctl Paul Clements
2006-09-28 7:31 ` Neil Brown
2006-09-28 6:34 ` [BUG/PATCH] md bitmap broken on big endian machines Neil Brown
2006-09-28 22:09 ` Michael Tokarev
2006-09-29 0:48 ` Paul Clements [this message]
2006-09-29 7:03 ` Michael Tokarev
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=451C6D64.5050807@steeleye.com \
--to=paul.clements@steeleye.com \
--cc=linux-raid@vger.kernel.org \
--cc=mjt@tls.msk.ru \
--cc=neilb@suse.de \
/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).