SHA256
1
0
forked from pool/mdadm
mdadm/0003-Work-around-architectures-having-statfs.f_type-defin.patch
Neil Brown ceac01b560 - 0001-DDF-mark-missing-on-assembly-device-properly.patch
- 0002-DDF-guard-against-pdnum-being-negative.patch
- 0003-DDF-fix-possible-mdmon-crash-when-updating-metadata.patch
- 0004-DDF-Don-t-fail-compare_super_ddf-due-to-re-configure.patch
  More upstream DDF fixes (bnc#866660)

- 0001-mdmon-.service-Change-type-of-process-start-up-to-fo.patch
- 0003-Work-around-architectures-having-statfs.f_type-defin.patch
- 0004-DDF-report-seq-counter-as-events.patch
- 0005-DDF-when-first-activating-an-array-record-any-missin.patch
  Two fixes for DDF (bnc#866660) and a couple of other upstream fixes
  just for good measure.

- 0001-Assemble-allow-load_devices-to-change-the-st-which-i.patch
  0002-Assemble-re-arrange-freeing-of-tst-in-load_devices.patch
  0003-Assemble-change-load_devices-to-return-most_recent-s.patch
  Allow RAID5 to be assembled even when firs device listed recently
  failed (bnc#865221)

OBS-URL: https://build.opensuse.org/package/show/Base:System/mdadm?expand=0&rev=105
2014-04-02 06:19:16 +00:00

39 lines
1.3 KiB
Diff

From 76d0f1886fdef89891d617df7e7f3fde89a38e1a Mon Sep 17 00:00:00 2001
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Date: Wed, 19 Mar 2014 14:26:02 +0100
Subject: [PATCH 3/6] Work around architectures having statfs.f_type defined as
long
Having RAMFS_MAGIC defined as 0x858458f6 causing problems when trying
to compare it directly against statfs.f_type being cast from long to
unsigned long.
This hack is extremly ugly, but it should at least do the right thing
for every situation.
Thanks to Arnd Bergmann for suggesting the fix.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
---
util.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- mdadm-3.3.orig/util.c
+++ mdadm-3.3/util.c
@@ -1948,9 +1948,13 @@ int in_initrd(void)
{
/* This is based on similar function in systemd. */
struct statfs s;
+ /* statfs.f_type is signed long on s390x and MIPS, causing all
+ sorts of sign extension problems with RAMFS_MAGIC being
+ defined as 0x858458f6 */
return statfs("/", &s) >= 0 &&
((unsigned long)s.f_type == TMPFS_MAGIC ||
- (unsigned long)s.f_type == RAMFS_MAGIC);
+ ((unsigned long)s.f_type & 0xFFFFFFFFUL) ==
+ ((unsigned long)RAMFS_MAGIC & 0xFFFFFFFFUL));
}
void reopen_mddev(int mdfd)