Contents of /trunk/kernel-lts/patches-3.4/0157-3.4.58-all-fixes.patch
Parent Directory
|
Revision Log
Revision 2264 -
(show annotations)
(download)
Mon Aug 19 09:33:43 2013 UTC (10 years, 9 months ago) by niro
File size: 15526 byte(s)
Mon Aug 19 09:33:43 2013 UTC (10 years, 9 months ago) by niro
File size: 15526 byte(s)
-fixed patches
1 | diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c |
2 | index f77e341..0cd2d50 100644 |
3 | --- a/drivers/char/virtio_console.c |
4 | +++ b/drivers/char/virtio_console.c |
5 | @@ -256,9 +256,12 @@ static struct port *find_port_by_devt_in_portdev(struct ports_device *portdev, |
6 | unsigned long flags; |
7 | |
8 | spin_lock_irqsave(&portdev->ports_lock, flags); |
9 | - list_for_each_entry(port, &portdev->ports, list) |
10 | - if (port->cdev->dev == dev) |
11 | + list_for_each_entry(port, &portdev->ports, list) { |
12 | + if (port->cdev->dev == dev) { |
13 | + kref_get(&port->kref); |
14 | goto out; |
15 | + } |
16 | + } |
17 | port = NULL; |
18 | out: |
19 | spin_unlock_irqrestore(&portdev->ports_lock, flags); |
20 | @@ -630,6 +633,10 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf, |
21 | |
22 | port = filp->private_data; |
23 | |
24 | + /* Port is hot-unplugged. */ |
25 | + if (!port->guest_connected) |
26 | + return -ENODEV; |
27 | + |
28 | if (!port_has_data(port)) { |
29 | /* |
30 | * If nothing's connected on the host just return 0 in |
31 | @@ -646,7 +653,7 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf, |
32 | if (ret < 0) |
33 | return ret; |
34 | } |
35 | - /* Port got hot-unplugged. */ |
36 | + /* Port got hot-unplugged while we were waiting above. */ |
37 | if (!port->guest_connected) |
38 | return -ENODEV; |
39 | /* |
40 | @@ -789,14 +796,14 @@ static int port_fops_open(struct inode *inode, struct file *filp) |
41 | struct port *port; |
42 | int ret; |
43 | |
44 | + /* We get the port with a kref here */ |
45 | port = find_port_by_devt(cdev->dev); |
46 | + if (!port) { |
47 | + /* Port was unplugged before we could proceed */ |
48 | + return -ENXIO; |
49 | + } |
50 | filp->private_data = port; |
51 | |
52 | - /* Prevent against a port getting hot-unplugged at the same time */ |
53 | - spin_lock_irq(&port->portdev->ports_lock); |
54 | - kref_get(&port->kref); |
55 | - spin_unlock_irq(&port->portdev->ports_lock); |
56 | - |
57 | /* |
58 | * Don't allow opening of console port devices -- that's done |
59 | * via /dev/hvc |
60 | @@ -1254,14 +1261,6 @@ static void remove_port(struct kref *kref) |
61 | |
62 | port = container_of(kref, struct port, kref); |
63 | |
64 | - sysfs_remove_group(&port->dev->kobj, &port_attribute_group); |
65 | - device_destroy(pdrvdata.class, port->dev->devt); |
66 | - cdev_del(port->cdev); |
67 | - |
68 | - kfree(port->name); |
69 | - |
70 | - debugfs_remove(port->debugfs_file); |
71 | - |
72 | kfree(port); |
73 | } |
74 | |
75 | @@ -1291,12 +1290,14 @@ static void unplug_port(struct port *port) |
76 | spin_unlock_irq(&port->portdev->ports_lock); |
77 | |
78 | if (port->guest_connected) { |
79 | + /* Let the app know the port is going down. */ |
80 | + send_sigio_to_port(port); |
81 | + |
82 | + /* Do this after sigio is actually sent */ |
83 | port->guest_connected = false; |
84 | port->host_connected = false; |
85 | - wake_up_interruptible(&port->waitqueue); |
86 | |
87 | - /* Let the app know the port is going down. */ |
88 | - send_sigio_to_port(port); |
89 | + wake_up_interruptible(&port->waitqueue); |
90 | } |
91 | |
92 | if (is_console_port(port)) { |
93 | @@ -1315,6 +1316,14 @@ static void unplug_port(struct port *port) |
94 | */ |
95 | port->portdev = NULL; |
96 | |
97 | + sysfs_remove_group(&port->dev->kobj, &port_attribute_group); |
98 | + device_destroy(pdrvdata.class, port->dev->devt); |
99 | + cdev_del(port->cdev); |
100 | + |
101 | + kfree(port->name); |
102 | + |
103 | + debugfs_remove(port->debugfs_file); |
104 | + |
105 | /* |
106 | * Locks around here are not necessary - a port can't be |
107 | * opened after we removed the port struct from ports_list |
108 | diff --git a/drivers/hwmon/adt7470.c b/drivers/hwmon/adt7470.c |
109 | index 54ec8905..034085d 100644 |
110 | --- a/drivers/hwmon/adt7470.c |
111 | +++ b/drivers/hwmon/adt7470.c |
112 | @@ -215,7 +215,7 @@ static inline int adt7470_write_word_data(struct i2c_client *client, u8 reg, |
113 | u16 value) |
114 | { |
115 | return i2c_smbus_write_byte_data(client, reg, value & 0xFF) |
116 | - && i2c_smbus_write_byte_data(client, reg + 1, value >> 8); |
117 | + || i2c_smbus_write_byte_data(client, reg + 1, value >> 8); |
118 | } |
119 | |
120 | static void adt7470_init_client(struct i2c_client *client) |
121 | diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c |
122 | index 073d5ad..7926162 100644 |
123 | --- a/drivers/scsi/megaraid/megaraid_sas_base.c |
124 | +++ b/drivers/scsi/megaraid/megaraid_sas_base.c |
125 | @@ -3493,11 +3493,21 @@ static int megasas_init_fw(struct megasas_instance *instance) |
126 | break; |
127 | } |
128 | |
129 | - /* |
130 | - * We expect the FW state to be READY |
131 | - */ |
132 | - if (megasas_transition_to_ready(instance, 0)) |
133 | - goto fail_ready_state; |
134 | + if (megasas_transition_to_ready(instance, 0)) { |
135 | + atomic_set(&instance->fw_reset_no_pci_access, 1); |
136 | + instance->instancet->adp_reset |
137 | + (instance, instance->reg_set); |
138 | + atomic_set(&instance->fw_reset_no_pci_access, 0); |
139 | + dev_info(&instance->pdev->dev, |
140 | + "megasas: FW restarted successfully from %s!\n", |
141 | + __func__); |
142 | + |
143 | + /*waitting for about 30 second before retry*/ |
144 | + ssleep(30); |
145 | + |
146 | + if (megasas_transition_to_ready(instance, 0)) |
147 | + goto fail_ready_state; |
148 | + } |
149 | |
150 | /* Check if MSI-X is supported while in ready state */ |
151 | msix_enable = (instance->instancet->read_fw_status_reg(reg_set) & |
152 | diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c |
153 | index 62b6168..e705ed3 100644 |
154 | --- a/drivers/scsi/nsp32.c |
155 | +++ b/drivers/scsi/nsp32.c |
156 | @@ -2926,7 +2926,7 @@ static void nsp32_do_bus_reset(nsp32_hw_data *data) |
157 | * reset SCSI bus |
158 | */ |
159 | nsp32_write1(base, SCSI_BUS_CONTROL, BUSCTL_RST); |
160 | - udelay(RESET_HOLD_TIME); |
161 | + mdelay(RESET_HOLD_TIME / 1000); |
162 | nsp32_write1(base, SCSI_BUS_CONTROL, 0); |
163 | for(i = 0; i < 5; i++) { |
164 | intrdat = nsp32_read2(base, IRQ_STATUS); /* dummy read */ |
165 | diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c |
166 | index 07322ec..29fabff 100644 |
167 | --- a/drivers/scsi/scsi.c |
168 | +++ b/drivers/scsi/scsi.c |
169 | @@ -1025,6 +1025,9 @@ int scsi_get_vpd_page(struct scsi_device *sdev, u8 page, unsigned char *buf, |
170 | { |
171 | int i, result; |
172 | |
173 | + if (sdev->skip_vpd_pages) |
174 | + goto fail; |
175 | + |
176 | /* Ask for all the pages supported by this device */ |
177 | result = scsi_vpd_inquiry(sdev, buf, 0, buf_len); |
178 | if (result) |
179 | diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c |
180 | index a969ec1..aa54fad 100644 |
181 | --- a/drivers/usb/core/hub.c |
182 | +++ b/drivers/usb/core/hub.c |
183 | @@ -3890,7 +3890,8 @@ static void hub_events(void) |
184 | hub->hdev->children[i - 1]; |
185 | |
186 | dev_dbg(hub_dev, "warm reset port %d\n", i); |
187 | - if (!udev) { |
188 | + if (!udev || !(portstatus & |
189 | + USB_PORT_STAT_CONNECTION)) { |
190 | status = hub_port_reset(hub, i, |
191 | NULL, HUB_BH_RESET_TIME, |
192 | true); |
193 | @@ -3900,8 +3901,8 @@ static void hub_events(void) |
194 | usb_lock_device(udev); |
195 | status = usb_reset_device(udev); |
196 | usb_unlock_device(udev); |
197 | + connect_change = 0; |
198 | } |
199 | - connect_change = 0; |
200 | } |
201 | |
202 | if (connect_change) |
203 | diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c |
204 | index 6d0c62a..6dd3b61 100644 |
205 | --- a/fs/cifs/cifsencrypt.c |
206 | +++ b/fs/cifs/cifsencrypt.c |
207 | @@ -369,7 +369,7 @@ find_domain_name(struct cifs_ses *ses, const struct nls_table *nls_cp) |
208 | if (blobptr + attrsize > blobend) |
209 | break; |
210 | if (type == NTLMSSP_AV_NB_DOMAIN_NAME) { |
211 | - if (!attrsize) |
212 | + if (!attrsize || attrsize >= CIFS_MAX_DOMAINNAME_LEN) |
213 | break; |
214 | if (!ses->domainName) { |
215 | ses->domainName = |
216 | diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h |
217 | index 73fea28..a5fcf19 100644 |
218 | --- a/fs/cifs/cifsglob.h |
219 | +++ b/fs/cifs/cifsglob.h |
220 | @@ -38,6 +38,7 @@ |
221 | #define MAX_TREE_SIZE (2 + MAX_SERVER_SIZE + 1 + MAX_SHARE_SIZE + 1) |
222 | #define MAX_SERVER_SIZE 15 |
223 | #define MAX_SHARE_SIZE 80 |
224 | +#define CIFS_MAX_DOMAINNAME_LEN 256 /* max domain name length */ |
225 | #define MAX_USERNAME_SIZE 256 /* reasonable maximum for current servers */ |
226 | #define MAX_PASSWORD_SIZE 512 /* max for windows seems to be 256 wide chars */ |
227 | |
228 | diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c |
229 | index 9cc574c..e7fe81d 100644 |
230 | --- a/fs/cifs/connect.c |
231 | +++ b/fs/cifs/connect.c |
232 | @@ -1698,7 +1698,8 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, |
233 | if (string == NULL) |
234 | goto out_nomem; |
235 | |
236 | - if (strnlen(string, 256) == 256) { |
237 | + if (strnlen(string, CIFS_MAX_DOMAINNAME_LEN) |
238 | + == CIFS_MAX_DOMAINNAME_LEN) { |
239 | printk(KERN_WARNING "CIFS: domain name too" |
240 | " long\n"); |
241 | goto cifs_parse_mount_err; |
242 | @@ -2356,8 +2357,8 @@ cifs_put_smb_ses(struct cifs_ses *ses) |
243 | |
244 | #ifdef CONFIG_KEYS |
245 | |
246 | -/* strlen("cifs:a:") + INET6_ADDRSTRLEN + 1 */ |
247 | -#define CIFSCREDS_DESC_SIZE (7 + INET6_ADDRSTRLEN + 1) |
248 | +/* strlen("cifs:a:") + CIFS_MAX_DOMAINNAME_LEN + 1 */ |
249 | +#define CIFSCREDS_DESC_SIZE (7 + CIFS_MAX_DOMAINNAME_LEN + 1) |
250 | |
251 | /* Populate username and pw fields from keyring if possible */ |
252 | static int |
253 | diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c |
254 | index 551d0c2..de9b1c1 100644 |
255 | --- a/fs/cifs/sess.c |
256 | +++ b/fs/cifs/sess.c |
257 | @@ -198,7 +198,7 @@ static void unicode_domain_string(char **pbcc_area, struct cifs_ses *ses, |
258 | bytes_ret = 0; |
259 | } else |
260 | bytes_ret = cifs_strtoUTF16((__le16 *) bcc_ptr, ses->domainName, |
261 | - 256, nls_cp); |
262 | + CIFS_MAX_DOMAINNAME_LEN, nls_cp); |
263 | bcc_ptr += 2 * bytes_ret; |
264 | bcc_ptr += 2; /* account for null terminator */ |
265 | |
266 | @@ -256,8 +256,8 @@ static void ascii_ssetup_strings(char **pbcc_area, struct cifs_ses *ses, |
267 | |
268 | /* copy domain */ |
269 | if (ses->domainName != NULL) { |
270 | - strncpy(bcc_ptr, ses->domainName, 256); |
271 | - bcc_ptr += strnlen(ses->domainName, 256); |
272 | + strncpy(bcc_ptr, ses->domainName, CIFS_MAX_DOMAINNAME_LEN); |
273 | + bcc_ptr += strnlen(ses->domainName, CIFS_MAX_DOMAINNAME_LEN); |
274 | } /* else we will send a null domain name |
275 | so the server will default to its own domain */ |
276 | *bcc_ptr = 0; |
277 | diff --git a/fs/dcache.c b/fs/dcache.c |
278 | index e498de2..9d39de4 100644 |
279 | --- a/fs/dcache.c |
280 | +++ b/fs/dcache.c |
281 | @@ -1556,7 +1556,7 @@ EXPORT_SYMBOL(d_find_any_alias); |
282 | */ |
283 | struct dentry *d_obtain_alias(struct inode *inode) |
284 | { |
285 | - static const struct qstr anonstring = { .name = "" }; |
286 | + static const struct qstr anonstring = { .name = "/", .len = 1 }; |
287 | struct dentry *tmp; |
288 | struct dentry *res; |
289 | |
290 | diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c |
291 | index b80bc84..9dc6e76 100644 |
292 | --- a/fs/debugfs/inode.c |
293 | +++ b/fs/debugfs/inode.c |
294 | @@ -527,8 +527,7 @@ EXPORT_SYMBOL_GPL(debugfs_remove); |
295 | */ |
296 | void debugfs_remove_recursive(struct dentry *dentry) |
297 | { |
298 | - struct dentry *child; |
299 | - struct dentry *parent; |
300 | + struct dentry *child, *next, *parent; |
301 | |
302 | if (!dentry) |
303 | return; |
304 | @@ -538,61 +537,37 @@ void debugfs_remove_recursive(struct dentry *dentry) |
305 | return; |
306 | |
307 | parent = dentry; |
308 | + down: |
309 | mutex_lock(&parent->d_inode->i_mutex); |
310 | + list_for_each_entry_safe(child, next, &parent->d_subdirs, d_u.d_child) { |
311 | + if (!debugfs_positive(child)) |
312 | + continue; |
313 | |
314 | - while (1) { |
315 | - /* |
316 | - * When all dentries under "parent" has been removed, |
317 | - * walk up the tree until we reach our starting point. |
318 | - */ |
319 | - if (list_empty(&parent->d_subdirs)) { |
320 | - mutex_unlock(&parent->d_inode->i_mutex); |
321 | - if (parent == dentry) |
322 | - break; |
323 | - parent = parent->d_parent; |
324 | - mutex_lock(&parent->d_inode->i_mutex); |
325 | - } |
326 | - child = list_entry(parent->d_subdirs.next, struct dentry, |
327 | - d_u.d_child); |
328 | - next_sibling: |
329 | - |
330 | - /* |
331 | - * If "child" isn't empty, walk down the tree and |
332 | - * remove all its descendants first. |
333 | - */ |
334 | + /* perhaps simple_empty(child) makes more sense */ |
335 | if (!list_empty(&child->d_subdirs)) { |
336 | mutex_unlock(&parent->d_inode->i_mutex); |
337 | parent = child; |
338 | - mutex_lock(&parent->d_inode->i_mutex); |
339 | - continue; |
340 | + goto down; |
341 | } |
342 | - __debugfs_remove(child, parent); |
343 | - if (parent->d_subdirs.next == &child->d_u.d_child) { |
344 | - /* |
345 | - * Try the next sibling. |
346 | - */ |
347 | - if (child->d_u.d_child.next != &parent->d_subdirs) { |
348 | - child = list_entry(child->d_u.d_child.next, |
349 | - struct dentry, |
350 | - d_u.d_child); |
351 | - goto next_sibling; |
352 | - } |
353 | - |
354 | - /* |
355 | - * Avoid infinite loop if we fail to remove |
356 | - * one dentry. |
357 | - */ |
358 | - mutex_unlock(&parent->d_inode->i_mutex); |
359 | - break; |
360 | - } |
361 | - simple_release_fs(&debugfs_mount, &debugfs_mount_count); |
362 | + up: |
363 | + if (!__debugfs_remove(child, parent)) |
364 | + simple_release_fs(&debugfs_mount, &debugfs_mount_count); |
365 | } |
366 | |
367 | - parent = dentry->d_parent; |
368 | + mutex_unlock(&parent->d_inode->i_mutex); |
369 | + child = parent; |
370 | + parent = parent->d_parent; |
371 | mutex_lock(&parent->d_inode->i_mutex); |
372 | - __debugfs_remove(dentry, parent); |
373 | + |
374 | + if (child != dentry) { |
375 | + next = list_entry(child->d_u.d_child.next, struct dentry, |
376 | + d_u.d_child); |
377 | + goto up; |
378 | + } |
379 | + |
380 | + if (!__debugfs_remove(child, parent)) |
381 | + simple_release_fs(&debugfs_mount, &debugfs_mount_count); |
382 | mutex_unlock(&parent->d_inode->i_mutex); |
383 | - simple_release_fs(&debugfs_mount, &debugfs_mount_count); |
384 | } |
385 | EXPORT_SYMBOL_GPL(debugfs_remove_recursive); |
386 | |
387 | diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c |
388 | index e42b468..b1c3f2a 100644 |
389 | --- a/fs/ext4/ialloc.c |
390 | +++ b/fs/ext4/ialloc.c |
391 | @@ -687,11 +687,8 @@ repeat_in_this_group: |
392 | ino = ext4_find_next_zero_bit((unsigned long *) |
393 | inode_bitmap_bh->b_data, |
394 | EXT4_INODES_PER_GROUP(sb), ino); |
395 | - if (ino >= EXT4_INODES_PER_GROUP(sb)) { |
396 | - if (++group == ngroups) |
397 | - group = 0; |
398 | - continue; |
399 | - } |
400 | + if (ino >= EXT4_INODES_PER_GROUP(sb)) |
401 | + goto next_group; |
402 | if (group == 0 && (ino+1) < EXT4_FIRST_INO(sb)) { |
403 | ext4_error(sb, "reserved inode found cleared - " |
404 | "inode=%lu", ino + 1); |
405 | @@ -709,6 +706,9 @@ repeat_in_this_group: |
406 | goto got; /* we grabbed the inode! */ |
407 | if (ino < EXT4_INODES_PER_GROUP(sb)) |
408 | goto repeat_in_this_group; |
409 | +next_group: |
410 | + if (++group == ngroups) |
411 | + group = 0; |
412 | } |
413 | err = -ENOSPC; |
414 | goto out; |
415 | diff --git a/fs/ext4/super.c b/fs/ext4/super.c |
416 | index b93de81..8bbb14c 100644 |
417 | --- a/fs/ext4/super.c |
418 | +++ b/fs/ext4/super.c |
419 | @@ -3232,7 +3232,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) |
420 | } |
421 | if (test_opt(sb, DIOREAD_NOLOCK)) { |
422 | ext4_msg(sb, KERN_ERR, "can't mount with " |
423 | - "both data=journal and delalloc"); |
424 | + "both data=journal and dioread_nolock"); |
425 | goto failed_mount; |
426 | } |
427 | if (test_opt(sb, DELALLOC)) |
428 | @@ -4397,6 +4397,21 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) |
429 | goto restore_opts; |
430 | } |
431 | |
432 | + if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) { |
433 | + if (test_opt2(sb, EXPLICIT_DELALLOC)) { |
434 | + ext4_msg(sb, KERN_ERR, "can't mount with " |
435 | + "both data=journal and delalloc"); |
436 | + err = -EINVAL; |
437 | + goto restore_opts; |
438 | + } |
439 | + if (test_opt(sb, DIOREAD_NOLOCK)) { |
440 | + ext4_msg(sb, KERN_ERR, "can't mount with " |
441 | + "both data=journal and dioread_nolock"); |
442 | + err = -EINVAL; |
443 | + goto restore_opts; |
444 | + } |
445 | + } |
446 | + |
447 | if (sbi->s_mount_flags & EXT4_MF_FS_ABORTED) |
448 | ext4_abort(sb, "Abort forced by user"); |
449 | |
450 | diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h |
451 | index 176a939..16cad53 100644 |
452 | --- a/include/linux/ftrace_event.h |
453 | +++ b/include/linux/ftrace_event.h |
454 | @@ -71,6 +71,8 @@ struct trace_iterator { |
455 | /* trace_seq for __print_flags() and __print_symbolic() etc. */ |
456 | struct trace_seq tmp_seq; |
457 | |
458 | + cpumask_var_t started; |
459 | + |
460 | /* The below is zeroed out in pipe_read */ |
461 | struct trace_seq seq; |
462 | struct trace_entry *ent; |
463 | @@ -83,7 +85,7 @@ struct trace_iterator { |
464 | loff_t pos; |
465 | long idx; |
466 | |
467 | - cpumask_var_t started; |
468 | + /* All new field here will be zeroed out in pipe_read */ |
469 | }; |
470 | |
471 | |
472 | diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c |
473 | index 13cd224..5dd9626 100644 |
474 | --- a/kernel/trace/trace.c |
475 | +++ b/kernel/trace/trace.c |
476 | @@ -3478,6 +3478,7 @@ waitagain: |
477 | memset(&iter->seq, 0, |
478 | sizeof(struct trace_iterator) - |
479 | offsetof(struct trace_iterator, seq)); |
480 | + cpumask_clear(iter->started); |
481 | iter->pos = -1; |
482 | |
483 | trace_event_read_lock(); |
484 | diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c |
485 | index 35ae568..9593f27 100644 |
486 | --- a/tools/perf/util/map.c |
487 | +++ b/tools/perf/util/map.c |
488 | @@ -15,7 +15,8 @@ const char *map_type__name[MAP__NR_TYPES] = { |
489 | |
490 | static inline int is_anon_memory(const char *filename) |
491 | { |
492 | - return strcmp(filename, "//anon") == 0; |
493 | + return !strcmp(filename, "//anon") || |
494 | + !strcmp(filename, "/anon_hugepage (deleted)"); |
495 | } |
496 | |
497 | static inline int is_no_dso_memory(const char *filename) |