From: NeilBrown <neilb@suse.de>
To: "Baldysiak, Pawel" <pawel.baldysiak@intel.com>
Cc: "linux-raid@vger.kernel.org" <linux-raid@vger.kernel.org>,
"Paszkiewicz, Artur" <artur.paszkiewicz@intel.com>
Subject: Re: [PATCH] Forbid merging with partially assembled IMSM array
Date: Mon, 2 Jun 2014 12:19:55 +1000 [thread overview]
Message-ID: <20140602121955.10a72b32@notabene.brown> (raw)
In-Reply-To: <84A53BEA6EAC69439B7E311E9B17A76F07918BDA@IRSMSX105.ger.corp.intel.com>
[-- Attachment #1: Type: text/plain, Size: 4046 bytes --]
On Fri, 30 May 2014 13:11:43 +0000 "Baldysiak, Pawel"
<pawel.baldysiak@intel.com> wrote:
> Changes introduced in commit:
> 0431869cec4c673309d9aa30a2df4b778bc0bd24
> enabled adding devices to partially assembled array.
> It causes assemble process to override checking controller of device.
>
> For example:
> If ones created IMSM array will be stopped, and some disks will be
> attached to different controller, mdadm will allow to fully assemble this
> array as one md device (due to marge one part to another).
>
> This patch resolve this problem by forbidding merge operation
> on arrays with IMSM metadata.
Why do you think this is a good thing?
You seem to be saying "You cannot access that data because I don't like
which controllers you have attached it to".
My thought is that you should provide access to data whenever possible.
Is there some important situation where the current behaviour will cause real
problems?
Maybe a warning might be appropriate, but failure doesn't seem sensible...
NeilBrown
>
> Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
> Reviewed-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
>
> ---
> Assemble.c | 23 +++++++++++++++++++++++
> 1 file changed, 23 insertions(+)
>
> diff --git a/Assemble.c b/Assemble.c
> index a57d384..9fb65e5 100644
> --- a/Assemble.c
> +++ b/Assemble.c
> @@ -1329,6 +1329,29 @@ try_again:
> return 1;
> }
> for (dv = pre_exist->devs; dv; dv = dv->next) {
> + if (strncmp(mp->metadata, "imsm", 4) == 0 && !c->force) {
> + int dfd;
> + char dn[20];
> + struct supertype *st2;
> + sprintf(dn, "%d:%d", dv->disk.major,
> + dv->disk.minor);
> + st2 = dup_super(st);
> + dfd = dev_open(dn, O_RDONLY);
> + if ((dfd > 0) && (st2->ss->load_super(st2, dfd, NULL) ||
> + (st->ss->compare_super(st, st2) != 0))) {
> + pr_err("IMSM metadata mismatch!\n");
> + pr_err("Aborting...\n");
> + close(dfd);
> + } else {
> + pr_err("IMSM Array already partially assembled!\n");
> + pr_err("Aborting...\n");
> + }
> + if (st2) {
> + st2->ss->free_super(st2);
> + free(st2);
> + }
> + return 1;
> + }
> /* We want to add this device to our list,
> * but it could already be there if "mdadm -I"
> * started *after* we checked for O_EXCL.
> --
> 1.9.0
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next parent reply other threads:[~2014-06-02 2:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <84A53BEA6EAC69439B7E311E9B17A76F07918BDA@IRSMSX105.ger.corp.intel.com>
2014-06-02 2:19 ` NeilBrown [this message]
2014-06-03 9:03 ` [PATCH] Forbid merging with partially assembled IMSM array Baldysiak, Pawel
2014-06-04 2:30 ` NeilBrown
2014-06-04 9:25 ` Baldysiak, Pawel
2014-06-05 6:27 ` NeilBrown
2014-06-13 9:48 ` Baldysiak, Pawel
2014-06-25 4:15 ` NeilBrown
2014-06-30 12:22 ` Baldysiak, Pawel
2014-07-08 2:00 ` NeilBrown
2014-05-30 14:36 Baldysiak, Pawel
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=20140602121955.10a72b32@notabene.brown \
--to=neilb@suse.de \
--cc=artur.paszkiewicz@intel.com \
--cc=linux-raid@vger.kernel.org \
--cc=pawel.baldysiak@intel.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).