-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmdadm-3.1.5-unused-param.patch
176 lines (168 loc) · 5.28 KB
/
mdadm-3.1.5-unused-param.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
--- mdadm-3.2.1/sysfs.c.param 2011-03-27 22:31:20.000000000 -0400
+++ mdadm-3.2.1/sysfs.c 2011-03-28 13:04:46.394625646 -0400
@@ -418,7 +418,7 @@ int sysfs_set_num(struct mdinfo *sra, st
int sysfs_uevent(struct mdinfo *sra, char *event)
{
char fname[50];
- int n;
+ unsigned int n;
int fd;
sprintf(fname, "/sys/block/%s/uevent",
@@ -428,6 +428,11 @@ int sysfs_uevent(struct mdinfo *sra, cha
return -1;
n = write(fd, event, strlen(event));
close(fd);
+ if (n != strlen(event)) {
+ dprintf(Name ": failed to write '%s' to '%s' (%s)\n",
+ event, fname, strerror(errno));
+ return -1;
+ }
return 0;
}
--- mdadm-3.2.1/mdadm.c.param 2011-03-27 22:31:20.000000000 -0400
+++ mdadm-3.2.1/mdadm.c 2011-03-28 13:04:46.395625718 -0400
@@ -103,7 +103,9 @@ int main(int argc, char *argv[])
char *shortopt = short_options;
int dosyslog = 0;
int rebuild_map = 0;
+#if 0
int auto_update_home = 0;
+#endif
char *subarray = NULL;
char *remove_path = NULL;
char *udev_filename = NULL;
@@ -1325,11 +1327,13 @@ int main(int argc, char *argv[])
cnt++;
acnt++;
}
+#if 0
if (rv2 == 1)
/* found something so even though assembly failed we
* want to avoid auto-updates
*/
auto_update_home = 0;
+#endif
} while (rv2!=2);
/* Incase there are stacked devices, we need to go around again */
} while (acnt);
--- mdadm-3.2.1/mdmon.c.param 2011-03-27 22:31:20.000000000 -0400
+++ mdadm-3.2.1/mdmon.c 2011-03-28 13:04:46.411626867 -0400
@@ -513,6 +513,9 @@ static int mdmon(char *devname, int devn
ignore = dup(0);
#endif
+ if (ignore)
+ ignore++;
+
do_manager(container);
exit(0);
--- mdadm-3.2.1/Grow.c.param 2011-03-27 22:31:20.000000000 -0400
+++ mdadm-3.2.1/Grow.c 2011-03-28 13:04:46.412626936 -0400
@@ -1312,7 +1312,6 @@ int Grow_reshape(char *devname, int fd,
char *subarray = NULL;
int frozen;
- int changed = 0;
char *container = NULL;
char container_buf[20];
int cfd = -1;
@@ -1479,7 +1478,6 @@ int Grow_reshape(char *devname, int fd,
if (!quiet)
fprintf(stderr, Name ": component size of %s has been set to %lluK\n",
devname, size);
- changed = 1;
} else if (array.level != LEVEL_CONTAINER) {
size = get_component_size(fd)/2;
if (size == 0)
--- mdadm-3.2.1/Query.c.param 2011-03-27 22:31:20.000000000 -0400
+++ mdadm-3.2.1/Query.c 2011-03-28 13:04:46.413627008 -0400
@@ -35,7 +35,7 @@ int Query(char *dev)
int fd = open(dev, O_RDONLY);
int vers;
int ioctlerr;
- int superror, superrno;
+ int superror;
struct mdinfo info;
mdu_array_info_t array;
struct supertype *st = NULL;
@@ -84,7 +84,6 @@ int Query(char *dev)
st = guess_super(fd);
if (st) {
superror = st->ss->load_super(st, fd, dev);
- superrno = errno;
} else
superror = -1;
close(fd);
--- mdadm-3.2.1/super1.c.param 2011-03-27 22:31:20.000000000 -0400
+++ mdadm-3.2.1/super1.c 2011-03-28 13:04:46.428628081 -0400
@@ -111,7 +111,6 @@ static unsigned int calc_sb_1_csum(struc
unsigned long long newcsum;
int size = sizeof(*sb) + __le32_to_cpu(sb->max_dev)*2;
unsigned int *isuper = (unsigned int*)sb;
- int i;
/* make sure I can count... */
if (offsetof(struct mdp_superblock_1,data_offset) != 128 ||
@@ -123,7 +122,7 @@ static unsigned int calc_sb_1_csum(struc
disk_csum = sb->sb_csum;
sb->sb_csum = 0;
newcsum = 0;
- for (i=0; size>=4; size -= 4 ) {
+ for (; size>=4; size -= 4 ) {
newcsum += __le32_to_cpu(*isuper);
isuper++;
}
@@ -387,15 +386,11 @@ static void examine_super1(struct supert
printf(" Array State : ");
for (d=0; d<__le32_to_cpu(sb->raid_disks) + delta_extra; d++) {
int cnt = 0;
- int me = 0;
unsigned int i;
for (i=0; i< __le32_to_cpu(sb->max_dev); i++) {
unsigned int role = __le16_to_cpu(sb->dev_roles[i]);
- if (role == d) {
- if (i == __le32_to_cpu(sb->dev_number))
- me = 1;
+ if (role == d)
cnt++;
- }
}
if (cnt > 1) printf("?");
else if (cnt == 1) printf("A");
--- mdadm-3.2.1/Incremental.c.param 2011-03-27 22:31:20.000000000 -0400
+++ mdadm-3.2.1/Incremental.c 2011-03-28 13:04:46.429628154 -0400
@@ -707,7 +707,7 @@ static int count_active(struct supertype
int cnt = 0;
__u64 max_events = 0;
char *avail = NULL;
- int *best;
+ int *best = NULL;
char *devmap = NULL;
int numdevs = 0;
int devnum;
--- mdadm-3.2.1/super-intel.c.param 2011-03-27 22:31:20.000000000 -0400
+++ mdadm-3.2.1/super-intel.c 2011-03-28 13:27:09.746073217 -0400
@@ -1858,7 +1858,9 @@ static void getinfo_super_imsm_volume(st
info->reshape_progress *= used_disks;
dprintf("IMSM: General Migration checkpoint : %llu "
"(%llu) -> read reshape progress : %llu\n",
- units, blocks_per_unit, info->reshape_progress);
+ (unsigned long long)units,
+ (unsigned long long)blocks_per_unit,
+ info->reshape_progress);
used_disks = imsm_num_data_members(dev, 1);
if (used_disks > 0) {
@@ -6164,7 +6166,7 @@ static int apply_takeover_update(struct
{
struct imsm_dev *dev = NULL;
struct intel_dev *dv;
- struct imsm_dev *dev_new;
+ struct imsm_dev *dev_new = NULL;
struct imsm_map *map;
struct dl *dm, *du;
int i;
@@ -7008,7 +7010,7 @@ static int imsm_create_metadata_update_f
int update_memory_size = 0;
struct imsm_update_reshape *u = NULL;
struct mdinfo *spares = NULL;
- int i;
+ int i = -1;
int delta_disks = 0;
struct mdinfo *dev;