linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jes.Sorensen@redhat.com
To: neilb@suse.de
Cc: linux-raid@vger.kernel.org, arnd@arndb.de, ralf@linux-mips.org
Subject: [PATCH 0/1] Work around systems defining statfs.f_type as long
Date: Wed, 19 Mar 2014 14:26:01 +0100	[thread overview]
Message-ID: <1395235562-24672-1-git-send-email-Jes.Sorensen@redhat.com> (raw)

From: Jes Sorensen <Jes.Sorensen@redhat.com>

Hi

I was scratching my head over this build failure on s390x - thanks to
Arnd for suggesting the solution.

Allowing RAMFS_MAGIC to be defined as a number > 31 bits was a mistake
from the beginning, but trying to change it now is probably going to
cause even more headaches.

The problem is that some architectures, such as s390x and MIPS, define
statfs.f_type as signed long, which means the cast to unsigned long
and then comparing it against RAMFS_MAGIC is going to fail.  Instead
this patch brutally casts both to unsigned long and then masks off the
lower 32 bits and comparing those - this avoids having to add #ifdef
cases to the code.

Cheers,
Jes

Jes Sorensen (1):
  Work around architectures having statfs.f_type defined as long

 util.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

-- 
1.8.5.3


             reply	other threads:[~2014-03-19 13:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-19 13:26 Jes.Sorensen [this message]
2014-03-19 13:26 ` [PATCH 1/1] Work around architectures having statfs.f_type defined as long Jes.Sorensen
2014-03-19 20:43   ` Arnd Bergmann
2014-03-19 22:24   ` NeilBrown

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=1395235562-24672-1-git-send-email-Jes.Sorensen@redhat.com \
    --to=jes.sorensen@redhat.com \
    --cc=arnd@arndb.de \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=ralf@linux-mips.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;
as well as URLs for NNTP newsgroup(s).