All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jes Sorensen <jes@linuxcare.com>
To: Ulrich.Weigand@de.ibm.com
Cc: linux-kernel@vger.kernel.org, schwidefsky@de.ibm.com
Subject: Re: NFS: set_bit on an 'int' variable OK for 64-bit?
Date: 11 Dec 2000 18:01:30 +0100	[thread overview]
Message-ID: <d34s0a7uz9.fsf@lxplus015.cern.ch> (raw)
In-Reply-To: <C12569B2.005C9182.00@d12mta01.de.ibm.com>
In-Reply-To: Ulrich.Weigand@de.ibm.com's message of "Mon, 11 Dec 2000 17:51:04 +0100"

>>>>> "Ulrich" == Ulrich Weigand <Ulrich.Weigand@de.ibm.com> writes:

Ulrich> Hello,

Ulrich> since test11, the NFS code uses the set_bit and related
Ulrich> routines to manipulate the wb_flags member of the nfs_page
Ulrich> struct (nfs_page.h).  Unfortunately, wb_flags has still data
Ulrich> type 'int'.

Ulrich> This is a problem (at least) on the 64-bit S/390 architecture,
Ulrich> as our ..._bit macros assume bit 0 is the least significant
Ulrich> bit of a 'long', which means due to big-endian byte order that
Ulrich> bit 0 resides in the 7th byte of the variable.  As an int
Ulrich> occupies only 4 bytes, however, set_bit(0, int) clobbers
Ulrich> memory.

Ulrich> Now the question is, who's correct?

You are, the bit macros should only be used on long's. It happens to
work on little endian bitfield machines like the Alpha but thats the
same as when we had the problem with bit operations on char * in the
file system code a couple of years ago.

The NFS code needs to be fixed for this then.

Jes
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2000-12-11 17:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-11 16:51 NFS: set_bit on an 'int' variable OK for 64-bit? Ulrich.Weigand
2000-12-11 17:01 ` Jes Sorensen [this message]
2000-12-11 17:08 ` Alan Cox
2000-12-15  5:47   ` Rusty Russell

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=d34s0a7uz9.fsf@lxplus015.cern.ch \
    --to=jes@linuxcare.com \
    --cc=Ulrich.Weigand@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schwidefsky@de.ibm.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 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.