Annotation of /trunk/kernel26-alx/patches-2.6.27-r3/0144-2.6.27.45-all-fixes.patch
Parent Directory | Revision Log
Revision 1176 -
(hide annotations)
(download)
Thu Oct 14 15:11:06 2010 UTC (13 years, 11 months ago) by niro
File size: 12985 byte(s)
Thu Oct 14 15:11:06 2010 UTC (13 years, 11 months ago) by niro
File size: 12985 byte(s)
-2.6.27-alx-r3: new magellan 0.5.2 kernel
1 | niro | 1176 | diff --git a/arch/s390/kvm/intercept.c b/arch/s390/kvm/intercept.c |
2 | index 6123610..060ede7 100644 | ||
3 | --- a/arch/s390/kvm/intercept.c | ||
4 | +++ b/arch/s390/kvm/intercept.c | ||
5 | @@ -199,7 +199,7 @@ static int handle_instruction_and_prog(struct kvm_vcpu *vcpu) | ||
6 | return rc2; | ||
7 | } | ||
8 | |||
9 | -static const intercept_handler_t intercept_funcs[0x48 >> 2] = { | ||
10 | +static const intercept_handler_t intercept_funcs[] = { | ||
11 | [0x00 >> 2] = handle_noop, | ||
12 | [0x04 >> 2] = handle_instruction, | ||
13 | [0x08 >> 2] = handle_prog, | ||
14 | @@ -216,7 +216,7 @@ int kvm_handle_sie_intercept(struct kvm_vcpu *vcpu) | ||
15 | intercept_handler_t func; | ||
16 | u8 code = vcpu->arch.sie_block->icptcode; | ||
17 | |||
18 | - if (code & 3 || code > 0x48) | ||
19 | + if (code & 3 || (code >> 2) >= ARRAY_SIZE(intercept_funcs)) | ||
20 | return -ENOTSUPP; | ||
21 | func = intercept_funcs[code >> 2]; | ||
22 | if (func) | ||
23 | diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c | ||
24 | index 0232485..c4b82c7 100644 | ||
25 | --- a/drivers/char/tty_io.c | ||
26 | +++ b/drivers/char/tty_io.c | ||
27 | @@ -2437,8 +2437,8 @@ static int tty_fasync(int fd, struct file *filp, int on) | ||
28 | pid = task_pid(current); | ||
29 | type = PIDTYPE_PID; | ||
30 | } | ||
31 | - spin_unlock_irqrestore(&tty->ctrl_lock, flags); | ||
32 | retval = __f_setown(filp, pid, type, 0); | ||
33 | + spin_unlock_irqrestore(&tty->ctrl_lock, flags); | ||
34 | if (retval) | ||
35 | goto out; | ||
36 | } else { | ||
37 | diff --git a/drivers/edac/i5000_edac.c b/drivers/edac/i5000_edac.c | ||
38 | index 4a16b5b..d4297dc 100644 | ||
39 | --- a/drivers/edac/i5000_edac.c | ||
40 | +++ b/drivers/edac/i5000_edac.c | ||
41 | @@ -566,7 +566,13 @@ static void i5000_process_nonfatal_error_info(struct mem_ctl_info *mci, | ||
42 | debugf0("\tUncorrected bits= 0x%x\n", ue_errors); | ||
43 | |||
44 | branch = EXTRACT_FBDCHAN_INDX(info->ferr_nf_fbd); | ||
45 | - channel = branch; | ||
46 | + | ||
47 | + /* | ||
48 | + * According with i5000 datasheet, bit 28 has no significance | ||
49 | + * for errors M4Err-M12Err and M17Err-M21Err, on FERR_NF_FBD | ||
50 | + */ | ||
51 | + channel = branch & 2; | ||
52 | + | ||
53 | bank = NREC_BANK(info->nrecmema); | ||
54 | rank = NREC_RANK(info->nrecmema); | ||
55 | rdwr = NREC_RDWR(info->nrecmema); | ||
56 | diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c | ||
57 | index 97b7633..4c3f124 100644 | ||
58 | --- a/drivers/scsi/megaraid/megaraid_sas.c | ||
59 | +++ b/drivers/scsi/megaraid/megaraid_sas.c | ||
60 | @@ -3462,7 +3462,7 @@ out: | ||
61 | return retval; | ||
62 | } | ||
63 | |||
64 | -static DRIVER_ATTR(poll_mode_io, S_IRUGO|S_IWUGO, | ||
65 | +static DRIVER_ATTR(poll_mode_io, S_IRUGO|S_IWUSR, | ||
66 | megasas_sysfs_show_poll_mode_io, | ||
67 | megasas_sysfs_set_poll_mode_io); | ||
68 | |||
69 | diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c | ||
70 | index 769f80f..3240519 100644 | ||
71 | --- a/drivers/usb/core/hub.c | ||
72 | +++ b/drivers/usb/core/hub.c | ||
73 | @@ -3015,6 +3015,9 @@ static void hub_events(void) | ||
74 | USB_PORT_FEAT_C_SUSPEND); | ||
75 | udev = hdev->children[i-1]; | ||
76 | if (udev) { | ||
77 | + /* TRSMRCY = 10 msec */ | ||
78 | + msleep(10); | ||
79 | + | ||
80 | usb_lock_device(udev); | ||
81 | ret = remote_wakeup(hdev-> | ||
82 | children[i-1]); | ||
83 | diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c | ||
84 | index df7b605..6ef2a89 100644 | ||
85 | --- a/drivers/usb/host/ehci-hcd.c | ||
86 | +++ b/drivers/usb/host/ehci-hcd.c | ||
87 | @@ -723,9 +723,10 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd) | ||
88 | |||
89 | /* start 20 msec resume signaling from this port, | ||
90 | * and make khubd collect PORT_STAT_C_SUSPEND to | ||
91 | - * stop that signaling. | ||
92 | + * stop that signaling. Use 5 ms extra for safety, | ||
93 | + * like usb_port_resume() does. | ||
94 | */ | ||
95 | - ehci->reset_done [i] = jiffies + msecs_to_jiffies (20); | ||
96 | + ehci->reset_done[i] = jiffies + msecs_to_jiffies(25); | ||
97 | ehci_dbg (ehci, "port %d remote wakeup\n", i + 1); | ||
98 | mod_timer(&hcd->rh_timer, ehci->reset_done[i]); | ||
99 | } | ||
100 | diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c | ||
101 | index 740835b..ef9b038 100644 | ||
102 | --- a/drivers/usb/host/ehci-hub.c | ||
103 | +++ b/drivers/usb/host/ehci-hub.c | ||
104 | @@ -119,9 +119,26 @@ static int ehci_bus_suspend (struct usb_hcd *hcd) | ||
105 | del_timer_sync(&ehci->watchdog); | ||
106 | del_timer_sync(&ehci->iaa_watchdog); | ||
107 | |||
108 | - port = HCS_N_PORTS (ehci->hcs_params); | ||
109 | spin_lock_irq (&ehci->lock); | ||
110 | |||
111 | + /* Once the controller is stopped, port resumes that are already | ||
112 | + * in progress won't complete. Hence if remote wakeup is enabled | ||
113 | + * for the root hub and any ports are in the middle of a resume or | ||
114 | + * remote wakeup, we must fail the suspend. | ||
115 | + */ | ||
116 | + if (hcd->self.root_hub->do_remote_wakeup) { | ||
117 | + port = HCS_N_PORTS(ehci->hcs_params); | ||
118 | + while (port--) { | ||
119 | + if (ehci->reset_done[port] != 0) { | ||
120 | + spin_unlock_irq(&ehci->lock); | ||
121 | + ehci_dbg(ehci, "suspend failed because " | ||
122 | + "port %d is resuming\n", | ||
123 | + port + 1); | ||
124 | + return -EBUSY; | ||
125 | + } | ||
126 | + } | ||
127 | + } | ||
128 | + | ||
129 | /* stop schedules, clean any completed work */ | ||
130 | if (HC_IS_RUNNING(hcd->state)) { | ||
131 | ehci_quiesce (ehci); | ||
132 | @@ -137,6 +154,7 @@ static int ehci_bus_suspend (struct usb_hcd *hcd) | ||
133 | */ | ||
134 | ehci->bus_suspended = 0; | ||
135 | ehci->owned_ports = 0; | ||
136 | + port = HCS_N_PORTS(ehci->hcs_params); | ||
137 | while (port--) { | ||
138 | u32 __iomem *reg = &ehci->regs->port_status [port]; | ||
139 | u32 t1 = ehci_readl(ehci, reg) & ~PORT_RWC_BITS; | ||
140 | diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c | ||
141 | index 01132ac..097dd55 100644 | ||
142 | --- a/drivers/usb/host/ehci-q.c | ||
143 | +++ b/drivers/usb/host/ehci-q.c | ||
144 | @@ -748,9 +748,10 @@ qh_make ( | ||
145 | * But interval 1 scheduling is simpler, and | ||
146 | * includes high bandwidth. | ||
147 | */ | ||
148 | - dbg ("intr period %d uframes, NYET!", | ||
149 | - urb->interval); | ||
150 | - goto done; | ||
151 | + urb->interval = 1; | ||
152 | + } else if (qh->period > ehci->periodic_size) { | ||
153 | + qh->period = ehci->periodic_size; | ||
154 | + urb->interval = qh->period << 3; | ||
155 | } | ||
156 | } else { | ||
157 | int think_time; | ||
158 | @@ -773,6 +774,10 @@ qh_make ( | ||
159 | usb_calc_bus_time (urb->dev->speed, | ||
160 | is_input, 0, max_packet (maxp))); | ||
161 | qh->period = urb->interval; | ||
162 | + if (qh->period > ehci->periodic_size) { | ||
163 | + qh->period = ehci->periodic_size; | ||
164 | + urb->interval = qh->period; | ||
165 | + } | ||
166 | } | ||
167 | } | ||
168 | |||
169 | diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c | ||
170 | index 59bed3c..dc25f4e 100644 | ||
171 | --- a/drivers/usb/host/uhci-hcd.c | ||
172 | +++ b/drivers/usb/host/uhci-hcd.c | ||
173 | @@ -750,7 +750,20 @@ static int uhci_rh_suspend(struct usb_hcd *hcd) | ||
174 | spin_lock_irq(&uhci->lock); | ||
175 | if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) | ||
176 | rc = -ESHUTDOWN; | ||
177 | - else if (!uhci->dead) | ||
178 | + else if (uhci->dead) | ||
179 | + ; /* Dead controllers tell no tales */ | ||
180 | + | ||
181 | + /* Once the controller is stopped, port resumes that are already | ||
182 | + * in progress won't complete. Hence if remote wakeup is enabled | ||
183 | + * for the root hub and any ports are in the middle of a resume or | ||
184 | + * remote wakeup, we must fail the suspend. | ||
185 | + */ | ||
186 | + else if (hcd->self.root_hub->do_remote_wakeup && | ||
187 | + uhci->resuming_ports) { | ||
188 | + dev_dbg(uhci_dev(uhci), "suspend failed because a port " | ||
189 | + "is resuming\n"); | ||
190 | + rc = -EBUSY; | ||
191 | + } else | ||
192 | suspend_rh(uhci, UHCI_RH_SUSPENDED); | ||
193 | spin_unlock_irq(&uhci->lock); | ||
194 | return rc; | ||
195 | diff --git a/drivers/usb/host/uhci-hub.c b/drivers/usb/host/uhci-hub.c | ||
196 | index 885b585..8270055 100644 | ||
197 | --- a/drivers/usb/host/uhci-hub.c | ||
198 | +++ b/drivers/usb/host/uhci-hub.c | ||
199 | @@ -167,7 +167,7 @@ static void uhci_check_ports(struct uhci_hcd *uhci) | ||
200 | /* Port received a wakeup request */ | ||
201 | set_bit(port, &uhci->resuming_ports); | ||
202 | uhci->ports_timeout = jiffies + | ||
203 | - msecs_to_jiffies(20); | ||
204 | + msecs_to_jiffies(25); | ||
205 | |||
206 | /* Make sure we see the port again | ||
207 | * after the resuming period is over. */ | ||
208 | diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c | ||
209 | index 06db79d..8c9ec6e 100644 | ||
210 | --- a/fs/ecryptfs/crypto.c | ||
211 | +++ b/fs/ecryptfs/crypto.c | ||
212 | @@ -1733,7 +1733,7 @@ ecryptfs_process_key_cipher(struct crypto_blkcipher **key_tfm, | ||
213 | char *cipher_name, size_t *key_size) | ||
214 | { | ||
215 | char dummy_key[ECRYPTFS_MAX_KEY_BYTES]; | ||
216 | - char *full_alg_name; | ||
217 | + char *full_alg_name = NULL; | ||
218 | int rc; | ||
219 | |||
220 | *key_tfm = NULL; | ||
221 | @@ -1748,7 +1748,6 @@ ecryptfs_process_key_cipher(struct crypto_blkcipher **key_tfm, | ||
222 | if (rc) | ||
223 | goto out; | ||
224 | *key_tfm = crypto_alloc_blkcipher(full_alg_name, 0, CRYPTO_ALG_ASYNC); | ||
225 | - kfree(full_alg_name); | ||
226 | if (IS_ERR(*key_tfm)) { | ||
227 | rc = PTR_ERR(*key_tfm); | ||
228 | printk(KERN_ERR "Unable to allocate crypto cipher with name " | ||
229 | @@ -1770,6 +1769,7 @@ ecryptfs_process_key_cipher(struct crypto_blkcipher **key_tfm, | ||
230 | goto out; | ||
231 | } | ||
232 | out: | ||
233 | + kfree(full_alg_name); | ||
234 | return rc; | ||
235 | } | ||
236 | |||
237 | diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c | ||
238 | index 9244d65..bbc723a 100644 | ||
239 | --- a/fs/ecryptfs/file.c | ||
240 | +++ b/fs/ecryptfs/file.c | ||
241 | @@ -192,13 +192,6 @@ static int ecryptfs_open(struct inode *inode, struct file *file) | ||
242 | | ECRYPTFS_ENCRYPTED); | ||
243 | } | ||
244 | mutex_unlock(&crypt_stat->cs_mutex); | ||
245 | - if ((ecryptfs_inode_to_private(inode)->lower_file->f_flags & O_RDONLY) | ||
246 | - && !(file->f_flags & O_RDONLY)) { | ||
247 | - rc = -EPERM; | ||
248 | - printk(KERN_WARNING "%s: Lower persistent file is RO; eCryptfs " | ||
249 | - "file must hence be opened RO\n", __func__); | ||
250 | - goto out; | ||
251 | - } | ||
252 | if (!ecryptfs_inode_to_private(inode)->lower_file) { | ||
253 | rc = ecryptfs_init_persistent_file(ecryptfs_dentry); | ||
254 | if (rc) { | ||
255 | @@ -209,6 +202,13 @@ static int ecryptfs_open(struct inode *inode, struct file *file) | ||
256 | goto out; | ||
257 | } | ||
258 | } | ||
259 | + if ((ecryptfs_inode_to_private(inode)->lower_file->f_flags & O_RDONLY) | ||
260 | + && !(file->f_flags & O_RDONLY)) { | ||
261 | + rc = -EPERM; | ||
262 | + printk(KERN_WARNING "%s: Lower persistent file is RO; eCryptfs " | ||
263 | + "file must hence be opened RO\n", __func__); | ||
264 | + goto out; | ||
265 | + } | ||
266 | ecryptfs_set_file_lower( | ||
267 | file, ecryptfs_inode_to_private(inode)->lower_file); | ||
268 | if (S_ISDIR(ecryptfs_dentry->d_inode->i_mode)) { | ||
269 | diff --git a/fs/fcntl.c b/fs/fcntl.c | ||
270 | index ac79b7e..4eed4d6 100644 | ||
271 | --- a/fs/fcntl.c | ||
272 | +++ b/fs/fcntl.c | ||
273 | @@ -200,7 +200,9 @@ static int setfl(int fd, struct file * filp, unsigned long arg) | ||
274 | static void f_modown(struct file *filp, struct pid *pid, enum pid_type type, | ||
275 | uid_t uid, uid_t euid, int force) | ||
276 | { | ||
277 | - write_lock_irq(&filp->f_owner.lock); | ||
278 | + unsigned long flags; | ||
279 | + | ||
280 | + write_lock_irqsave(&filp->f_owner.lock, flags); | ||
281 | if (force || !filp->f_owner.pid) { | ||
282 | put_pid(filp->f_owner.pid); | ||
283 | filp->f_owner.pid = get_pid(pid); | ||
284 | @@ -208,7 +210,7 @@ static void f_modown(struct file *filp, struct pid *pid, enum pid_type type, | ||
285 | filp->f_owner.uid = uid; | ||
286 | filp->f_owner.euid = euid; | ||
287 | } | ||
288 | - write_unlock_irq(&filp->f_owner.lock); | ||
289 | + write_unlock_irqrestore(&filp->f_owner.lock, flags); | ||
290 | } | ||
291 | |||
292 | int __f_setown(struct file *filp, struct pid *pid, enum pid_type type, | ||
293 | diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c | ||
294 | index 8c2615e..59973bc 100644 | ||
295 | --- a/fs/reiserfs/inode.c | ||
296 | +++ b/fs/reiserfs/inode.c | ||
297 | @@ -2545,6 +2545,12 @@ static int reiserfs_writepage(struct page *page, struct writeback_control *wbc) | ||
298 | return reiserfs_write_full_page(page, wbc); | ||
299 | } | ||
300 | |||
301 | +static void reiserfs_truncate_failed_write(struct inode *inode) | ||
302 | +{ | ||
303 | + truncate_inode_pages(inode->i_mapping, inode->i_size); | ||
304 | + reiserfs_truncate_file(inode, 0); | ||
305 | +} | ||
306 | + | ||
307 | static int reiserfs_write_begin(struct file *file, | ||
308 | struct address_space *mapping, | ||
309 | loff_t pos, unsigned len, unsigned flags, | ||
310 | @@ -2611,6 +2617,8 @@ static int reiserfs_write_begin(struct file *file, | ||
311 | if (ret) { | ||
312 | unlock_page(page); | ||
313 | page_cache_release(page); | ||
314 | + /* Truncate allocated blocks */ | ||
315 | + reiserfs_truncate_failed_write(inode); | ||
316 | } | ||
317 | return ret; | ||
318 | } | ||
319 | @@ -2703,8 +2711,7 @@ static int reiserfs_write_end(struct file *file, struct address_space *mapping, | ||
320 | ** transaction tracking stuff when the size changes. So, we have | ||
321 | ** to do the i_size updates here. | ||
322 | */ | ||
323 | - pos += copied; | ||
324 | - if (pos > inode->i_size) { | ||
325 | + if (pos + copied > inode->i_size) { | ||
326 | struct reiserfs_transaction_handle myth; | ||
327 | reiserfs_write_lock(inode->i_sb); | ||
328 | /* If the file have grown beyond the border where it | ||
329 | @@ -2722,7 +2729,7 @@ static int reiserfs_write_end(struct file *file, struct address_space *mapping, | ||
330 | goto journal_error; | ||
331 | } | ||
332 | reiserfs_update_inode_transaction(inode); | ||
333 | - inode->i_size = pos; | ||
334 | + inode->i_size = pos + copied; | ||
335 | /* | ||
336 | * this will just nest into our transaction. It's important | ||
337 | * to use mark_inode_dirty so the inode gets pushed around on the | ||
338 | @@ -2749,6 +2756,10 @@ static int reiserfs_write_end(struct file *file, struct address_space *mapping, | ||
339 | out: | ||
340 | unlock_page(page); | ||
341 | page_cache_release(page); | ||
342 | + | ||
343 | + if (pos + len > inode->i_size) | ||
344 | + reiserfs_truncate_failed_write(inode); | ||
345 | + | ||
346 | return ret == 0 ? copied : ret; | ||
347 | |||
348 | journal_error: | ||
349 | diff --git a/ipc/msg.c b/ipc/msg.c | ||
350 | index 2ceab7f..779f762 100644 | ||
351 | --- a/ipc/msg.c | ||
352 | +++ b/ipc/msg.c | ||
353 | @@ -125,6 +125,7 @@ void msg_init_ns(struct ipc_namespace *ns) | ||
354 | void msg_exit_ns(struct ipc_namespace *ns) | ||
355 | { | ||
356 | free_ipcs(ns, &msg_ids(ns), freeque); | ||
357 | + idr_destroy(&ns->ids[IPC_MSG_IDS].ipcs_idr); | ||
358 | } | ||
359 | #endif | ||
360 | |||
361 | diff --git a/ipc/sem.c b/ipc/sem.c | ||
362 | index 9eb9d31..0c0b28e 100644 | ||
363 | --- a/ipc/sem.c | ||
364 | +++ b/ipc/sem.c | ||
365 | @@ -129,6 +129,7 @@ void sem_init_ns(struct ipc_namespace *ns) | ||
366 | void sem_exit_ns(struct ipc_namespace *ns) | ||
367 | { | ||
368 | free_ipcs(ns, &sem_ids(ns), freeary); | ||
369 | + idr_destroy(&ns->ids[IPC_SEM_IDS].ipcs_idr); | ||
370 | } | ||
371 | #endif | ||
372 | |||
373 | diff --git a/ipc/shm.c b/ipc/shm.c | ||
374 | index 35a65be..37caa44 100644 | ||
375 | --- a/ipc/shm.c | ||
376 | +++ b/ipc/shm.c | ||
377 | @@ -100,6 +100,7 @@ static void do_shm_rmid(struct ipc_namespace *ns, struct kern_ipc_perm *ipcp) | ||
378 | void shm_exit_ns(struct ipc_namespace *ns) | ||
379 | { | ||
380 | free_ipcs(ns, &shm_ids(ns), do_shm_rmid); | ||
381 | + idr_destroy(&ns->ids[IPC_SHM_IDS].ipcs_idr); | ||
382 | } | ||
383 | #endif | ||
384 |