From: Michael Tokarev <mjt@tls.msk.ru>
To: Neil Brown <neilb@suse.de>
Cc: Paul Clements <paul.clements@steeleye.com>, linux-raid@vger.kernel.org
Subject: Re: [BUG/PATCH] md bitmap broken on big endian machines
Date: Fri, 29 Sep 2006 02:09:24 +0400 [thread overview]
Message-ID: <451C4814.9030601@tls.msk.ru> (raw)
In-Reply-To: <17691.27892.571457.628971@cse.unsw.edu.au>
Neil Brown wrote:
[]
> Use ffz instead of find_first_set to convert multiplier to shift.
>
> From: Paul Clements <paul.clements@steeleye.com>
>
> find_first_set doesn't find the least-significant bit on bigendian
> machines, so it is really wrong to use it.
>
> 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... ;)
/mjt
next prev parent reply other threads:[~2006-09-28 22:09 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 [this message]
2006-09-29 0:48 ` Paul Clements
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=451C4814.9030601@tls.msk.ru \
--to=mjt@tls.msk.ru \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.de \
--cc=paul.clements@steeleye.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;
as well as URLs for NNTP newsgroup(s).