]> git.pld-linux.org Git - packages/mdadm.git/blob - assemble-fail-fix.patch
- upstream fix for array assembling
[packages/mdadm.git] / assemble-fail-fix.patch
1 From 5141638c54535b4ac80b8481404d868a63a18ecd Mon Sep 17 00:00:00 2001
2 From: NeilBrown <neilb@suse.de>
3 Date: Tue, 29 Jul 2014 13:48:23 +1000
4 Subject: [PATCH] Assemble: Only fail auto-assemble in face of mdadm.conf
5  conflicts.
6
7 We should never auto-assemble things that conflict with mdadm.conf
8 However explicit assembly requests should be allowed.
9
10 Reported-by: olovopb
11 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1070245
12 Signed-off-by: NeilBrown <neilb@suse.de>
13 ---
14  Assemble.c | 47 ++++++++++++++++++++++++++---------------------
15  1 file changed, 26 insertions(+), 21 deletions(-)
16
17 diff --git a/Assemble.c b/Assemble.c
18 index aca28be..cdcdb0f 100644
19 --- a/Assemble.c
20 +++ b/Assemble.c
21 @@ -366,9 +366,6 @@ static int select_devices(struct mddev_dev *devlist,
22                         tmpdev = NULL;
23                         goto loop;
24                 } else {
25 -                       int rv = 0;
26 -                       struct mddev_ident *match;
27 -
28                         content = *contentp;
29                         tst->ss->getinfo_super(tst, content, NULL);
30  
31 @@ -377,25 +374,33 @@ static int select_devices(struct mddev_dev *devlist,
32                                            report_mismatch ? devname : NULL))
33                                 goto loop;
34  
35 -                       match = conf_match(tst, content, devname,
36 -                                          report_mismatch ? c->verbose : -1,
37 -                                          &rv);
38 -                       if (!match && rv == 2)
39 -                               goto loop;
40 -                       if (match && match->devname &&
41 -                           strcasecmp(match->devname, "<ignore>") == 0) {
42 -                               if (report_mismatch)
43 -                                       pr_err("%s is a member of an explicitly ignored array\n",
44 -                                              devname);
45 -                               goto loop;
46 -                       }
47 -                       if (match && !ident_matches(match, content, tst,
48 -                                                   c->homehost, c->update,
49 -                                                   report_mismatch ? devname : NULL))
50 -                               /* Array exists  in mdadm.conf but some
51 -                                * details don't match, so reject it
52 +                       if (auto_assem) {
53 +                               /* Never auto-assemble things that conflict
54 +                                * with mdadm.conf in some way
55                                  */
56 -                               goto loop;
57 +                               struct mddev_ident *match;
58 +                               int rv = 0;
59 +
60 +                               match = conf_match(tst, content, devname,
61 +                                                  report_mismatch ? c->verbose : -1,
62 +                                                  &rv);
63 +                               if (!match && rv == 2)
64 +                                       goto loop;
65 +                               if (match && match->devname &&
66 +                                   strcasecmp(match->devname, "<ignore>") == 0) {
67 +                                       if (report_mismatch)
68 +                                               pr_err("%s is a member of an explicitly ignored array\n",
69 +                                                      devname);
70 +                                       goto loop;
71 +                               }
72 +                               if (match && !ident_matches(match, content, tst,
73 +                                                           c->homehost, c->update,
74 +                                                           report_mismatch ? devname : NULL))
75 +                                       /* Array exists  in mdadm.conf but some
76 +                                        * details don't match, so reject it
77 +                                        */
78 +                                       goto loop;
79 +                       }
80  
81                         /* should be safe to try an exclusive open now, we
82                          * have rejected anything that some other mdadm might
83 -- 
84 2.0.3
85
This page took 0.057126 seconds and 3 git commands to generate.