From: NeilBrown <neilb@suse.de>
To: Martin Wilck <mwilck@arcor.de>
Cc: "David F." <df7729@gmail.com>, linux-raid@vger.kernel.org
Subject: Re: MDADM 3.3 broken?
Date: Wed, 20 Nov 2013 10:51:15 +1100 [thread overview]
Message-ID: <20131120105115.27494ab6@notabene.brown> (raw)
In-Reply-To: <528BBFEB.7050202@arcor.de>
[-- Attachment #1: Type: text/plain, Size: 3118 bytes --]
On Tue, 19 Nov 2013 20:45:47 +0100 Martin Wilck <mwilck@arcor.de> wrote:
> On 11/19/2013 01:01 AM, NeilBrown wrote:
> > On Mon, 18 Nov 2013 15:13:58 -0800 "David F." <df7729@gmail.com> wrote:
> >
> >
> >> output of 'mdadm --assemble --scan --no-degraded -v' (mdadm 3.2.6):
> > ...
> >> mdadm: no RAID superblock on /dev/sdc2
> >
> >
> >
> >>
> >> output1 of 'mdadm --assemble --scan --no-degraded -v' (mdadm 3.3 -
> >> note using /dev/sdc2, not /dev/sdc):
> > .....
> >> mdadm: /dev/sdc2 is identified as a member of /dev/md/imsm0, slot -1.
> >
> > So there is the problem. mdadm 3.2.6 sees no RAID superblock on sdc2, while
> > mdadm 3.3 does (but should not).
> >
> >
> > However that code hasn't changed!
> >
> > load_super_imsm() still starts with:
> >
> >
> > if (test_partition(fd))
> > /* IMSM not allowed on partitions */
> > return 1;
>
> Well not quite - you changed that code in commit b31df436 "intel,ddf:
> don't require partitions when ignore_hw_compat is set". Maybe there's
> something wrong with that ignore_hw_compat logic?
>
> In the strace I don't see indication of test_partition having been
> called, that's another hint in that direction.
>
Yes... I seems I was accidentally looking at an old version of mdadm.
I've just committed the following patch which should fix the problem.
(git clone git://neil.brown.name/mdadm/ ; cd mdadm ; make;make install)
Thanks,
NeilBrown
From 357ac1067835d1cdd5f80acc28501db0ffc64957 Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.de>
Date: Wed, 20 Nov 2013 10:49:14 +1100
Subject: [PATCH] IMSM metadata really should be ignored when found on
partitions.
commit b31df43682216d1c65813eae49ebdd8253db8907
changed load_super_imsm to not insist on finding a partition if
ignore_hw_compat was set.
Unfortunately this is set for '--assemble' so arrays could get
assembled badly.
The comment says this was to allow e.g. --examine of image files.
A better fixes for this is to change test_partitions to not report
a regular file as being a partition.
The errors from the BLKPG ioctl are:
ENOTTY : not a block device.
EINVAL : not a whole device (probably a partition)
ENXIO : partition doesn't exist (so not a partition)
Reported-by: "David F." <df7729@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
diff --git a/super-intel.c b/super-intel.c
index 7b2406866493..c103ffdd2dd8 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -4423,7 +4423,7 @@ static int load_super_imsm(struct supertype *st, int fd, char *devname)
struct intel_super *super;
int rv;
- if (!st->ignore_hw_compat && test_partition(fd))
+ if (test_partition(fd))
/* IMSM not allowed on partitions */
return 1;
diff --git a/util.c b/util.c
index 5f95f1f97c02..b29a3ee7ce47 100644
--- a/util.c
+++ b/util.c
@@ -307,7 +307,7 @@ int test_partition(int fd)
if (ioctl(fd, BLKPG, &a) == 0)
/* Very unlikely, but not a partition */
return 0;
- if (errno == ENXIO)
+ if (errno == ENXIO || errno == ENOTTY)
/* not a partition */
return 0;
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next prev parent reply other threads:[~2013-11-19 23:51 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-18 18:26 MDADM 3.3 broken? David F.
2013-11-18 20:22 ` Martin Wilck
2013-11-18 23:13 ` David F.
2013-11-19 0:01 ` NeilBrown
2013-11-19 17:05 ` David F.
2013-11-19 20:38 ` Martin Wilck
2013-11-19 22:34 ` David F.
2013-11-19 22:49 ` David F.
2013-11-19 19:45 ` Martin Wilck
2013-11-19 20:08 ` David F.
2013-11-19 23:51 ` NeilBrown [this message]
2013-11-20 0:22 ` David F.
2013-11-20 0:35 ` David F.
2013-11-20 0:48 ` NeilBrown
2013-11-20 1:29 ` David F.
2013-11-20 1:34 ` David F.
2013-11-20 2:30 ` NeilBrown
2013-11-20 6:41 ` David F.
2013-11-20 23:15 ` David F.
2013-11-21 20:50 ` Martin Wilck
2013-11-21 21:10 ` David F.
2013-11-21 21:30 ` Martin Wilck
2013-11-21 22:39 ` David F.
2013-11-25 21:39 ` Martin Wilck
2013-11-21 20:46 ` Martin Wilck
2013-11-21 21:06 ` David F.
2013-11-21 23:05 ` David F.
2013-11-21 23:09 ` David F.
2013-11-22 3:06 ` David F.
2013-11-22 18:36 ` David F.
2013-11-23 23:36 ` David F.
2013-11-25 21:56 ` Martin Wilck
2013-11-26 0:24 ` David F.
2013-11-26 21:59 ` David F.
2013-11-27 22:40 ` Martin Wilck
2013-12-06 1:53 ` David F.
2013-12-07 2:28 ` David F.
2013-12-07 3:16 ` NeilBrown
2013-12-07 3:46 ` David F.
2013-12-14 21:01 ` David F.
2014-01-20 4:34 ` NeilBrown
2014-01-20 21:52 ` Martin Wilck
2014-01-20 23:54 ` David F.
2014-01-22 22:32 ` David F.
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=20131120105115.27494ab6@notabene.brown \
--to=neilb@suse.de \
--cc=df7729@gmail.com \
--cc=linux-raid@vger.kernel.org \
--cc=mwilck@arcor.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).