1 From: Greg Kroah-Hartman <gregkh@suse.de>
2 Subject: Linux 2.6.27.4
4 Upstream 2.6.27.4 release from kernel.org
6 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
8 diff --git a/Makefile b/Makefile
9 index e4b635a..7529a72 100644
18 NAME = Trembling Tortoise
21 diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
22 index 426e5d9..c44cd6d 100644
23 --- a/arch/x86/kernel/acpi/sleep.c
24 +++ b/arch/x86/kernel/acpi/sleep.c
26 #include <linux/dmi.h>
27 #include <linux/cpumask.h>
28 #include <asm/segment.h>
29 +#include <asm/desc.h>
31 #include "realmode/wakeup.h"
33 @@ -98,6 +99,8 @@ int acpi_save_state_mem(void)
34 header->trampoline_segment = setup_trampoline() >> 4;
36 stack_start.sp = temp_stack + 4096;
37 + early_gdt_descr.address =
38 + (unsigned long)get_cpu_gdt_table(smp_processor_id());
40 initial_code = (unsigned long)wakeup_long64;
41 saved_magic = 0x123456789abcdef0;
42 diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
43 index a69cc0f..bccd0ef 100644
44 --- a/arch/x86/kernel/amd_iommu_init.c
45 +++ b/arch/x86/kernel/amd_iommu_init.c
46 @@ -210,7 +210,7 @@ static void __init iommu_set_exclusion_range(struct amd_iommu *iommu)
47 /* Programs the physical address of the device table into the IOMMU hardware */
48 static void __init iommu_set_device_table(struct amd_iommu *iommu)
53 BUG_ON(iommu->mmio_base == NULL);
55 diff --git a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c
56 index dba3cfb..ecb6ace 100644
57 --- a/drivers/acpi/hardware/hwsleep.c
58 +++ b/drivers/acpi/hardware/hwsleep.c
59 @@ -78,19 +78,17 @@ acpi_set_firmware_waking_vector(acpi_physical_address physical_address)
60 return_ACPI_STATUS(status);
63 - /* Set the vector */
65 + * According to the ACPI specification 2.0c and later, the 64-bit
66 + * waking vector should be cleared and the 32-bit waking vector should
67 + * be used, unless we want the wake-up code to be called by the BIOS in
68 + * Protected Mode. Some systems (for example HP dv5-1004nr) are known
69 + * to fail to resume if the 64-bit vector is used.
71 + if (facs->version >= 1)
72 + facs->xfirmware_waking_vector = 0;
74 - if ((facs->length < 32) || (!(facs->xfirmware_waking_vector))) {
76 - * ACPI 1.0 FACS or short table or optional X_ field is zero
78 - facs->firmware_waking_vector = (u32) physical_address;
81 - * ACPI 2.0 FACS with valid X_ field
83 - facs->xfirmware_waking_vector = physical_address;
85 + facs->firmware_waking_vector = (u32)physical_address;
87 return_ACPI_STATUS(AE_OK);
89 @@ -134,20 +132,7 @@ acpi_get_firmware_waking_vector(acpi_physical_address * physical_address)
94 - if ((facs->length < 32) || (!(facs->xfirmware_waking_vector))) {
96 - * ACPI 1.0 FACS or short table or optional X_ field is zero
99 - (acpi_physical_address) facs->firmware_waking_vector;
102 - * ACPI 2.0 FACS with valid X_ field
104 - *physical_address =
105 - (acpi_physical_address) facs->xfirmware_waking_vector;
107 + *physical_address = (acpi_physical_address)facs->firmware_waking_vector;
109 return_ACPI_STATUS(AE_OK);
111 diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c
112 index d13194a..4751909 100644
113 --- a/drivers/acpi/sleep/main.c
114 +++ b/drivers/acpi/sleep/main.c
115 @@ -200,6 +200,8 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
119 + /* If ACPI is not enabled by the BIOS, we need to enable it here. */
121 /* Reprogram control registers and execute _BFS */
122 acpi_leave_sleep_state_prep(acpi_state);
124 @@ -296,6 +298,14 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
125 DMI_MATCH(DMI_BOARD_NAME, "KN9 Series(NF-CK804)"),
129 + .callback = init_old_suspend_ordering,
130 + .ident = "HP xw4600 Workstation",
132 + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
133 + DMI_MATCH(DMI_PRODUCT_NAME, "HP xw4600 Workstation"),
138 #endif /* CONFIG_SUSPEND */
139 diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
140 index fd64137..f2e4caf 100644
141 --- a/drivers/char/hvc_console.c
142 +++ b/drivers/char/hvc_console.c
143 @@ -367,13 +367,13 @@ static void hvc_close(struct tty_struct *tty, struct file * filp)
144 spin_lock_irqsave(&hp->lock, flags);
146 if (--hp->count == 0) {
147 - if (hp->ops->notifier_del)
148 - hp->ops->notifier_del(hp, hp->data);
150 /* We are done with the tty pointer now. */
152 spin_unlock_irqrestore(&hp->lock, flags);
154 + if (hp->ops->notifier_del)
155 + hp->ops->notifier_del(hp, hp->data);
158 * Chain calls chars_in_buffer() and returns immediately if
159 * there is no buffered data otherwise sleeps on a wait queue
160 @@ -416,11 +416,11 @@ static void hvc_hangup(struct tty_struct *tty)
164 + spin_unlock_irqrestore(&hp->lock, flags);
166 if (hp->ops->notifier_del)
167 hp->ops->notifier_del(hp, hp->data);
169 - spin_unlock_irqrestore(&hp->lock, flags);
171 while(temp_open_count) {
173 kref_put(&hp->kref, destroy_hvc_struct);
174 diff --git a/drivers/edac/cell_edac.c b/drivers/edac/cell_edac.c
175 index 0e024fe..887072f 100644
176 --- a/drivers/edac/cell_edac.c
177 +++ b/drivers/edac/cell_edac.c
178 @@ -142,7 +142,7 @@ static void __devinit cell_edac_init_csrows(struct mem_ctl_info *mci)
179 csrow->nr_pages = (r.end - r.start + 1) >> PAGE_SHIFT;
180 csrow->last_page = csrow->first_page + csrow->nr_pages - 1;
181 csrow->mtype = MEM_XDR;
182 - csrow->edac_mode = EDAC_FLAG_EC | EDAC_FLAG_SECDED;
183 + csrow->edac_mode = EDAC_SECDED;
185 "Initialized on node %d, chanmask=0x%x,"
186 " first_page=0x%lx, nr_pages=0x%x\n",
187 diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
188 index 8d29405..59f6ad8 100644
189 --- a/drivers/gpio/gpiolib.c
190 +++ b/drivers/gpio/gpiolib.c
191 @@ -1020,7 +1020,7 @@ int gpio_get_value_cansleep(unsigned gpio)
193 might_sleep_if(extra_checks);
194 chip = gpio_to_chip(gpio);
195 - return chip->get(chip, gpio - chip->base);
196 + return chip->get ? chip->get(chip, gpio - chip->base) : 0;
198 EXPORT_SYMBOL_GPL(gpio_get_value_cansleep);
200 diff --git a/drivers/md/dm-kcopyd.c b/drivers/md/dm-kcopyd.c
201 index 996802b..8f15353 100644
202 --- a/drivers/md/dm-kcopyd.c
203 +++ b/drivers/md/dm-kcopyd.c
204 @@ -268,6 +268,17 @@ static void push(struct list_head *jobs, struct kcopyd_job *job)
205 spin_unlock_irqrestore(&kc->job_lock, flags);
209 +static void push_head(struct list_head *jobs, struct kcopyd_job *job)
211 + unsigned long flags;
212 + struct dm_kcopyd_client *kc = job->kc;
214 + spin_lock_irqsave(&kc->job_lock, flags);
215 + list_add(&job->list, jobs);
216 + spin_unlock_irqrestore(&kc->job_lock, flags);
220 * These three functions process 1 item from the corresponding
222 @@ -398,7 +409,7 @@ static int process_jobs(struct list_head *jobs, struct dm_kcopyd_client *kc,
223 * We couldn't service this job ATM, so
224 * push this job back onto the list.
227 + push_head(jobs, job);
231 diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
232 index 6e5528a..4ed9b7a 100644
233 --- a/drivers/md/dm-snap.c
234 +++ b/drivers/md/dm-snap.c
235 @@ -824,8 +824,10 @@ static struct bio *put_pending_exception(struct dm_snap_pending_exception *pe)
236 * the bios for the original write to the origin.
239 - atomic_dec_and_test(&primary_pe->ref_count))
240 + atomic_dec_and_test(&primary_pe->ref_count)) {
241 origin_bios = bio_list_get(&primary_pe->origin_bios);
242 + free_pending_exception(primary_pe);
246 * Free the pe if it's not linked to an origin write or if
247 @@ -834,12 +836,6 @@ static struct bio *put_pending_exception(struct dm_snap_pending_exception *pe)
248 if (!primary_pe || primary_pe != pe)
249 free_pending_exception(pe);
252 - * Free the primary pe if nothing references it.
254 - if (primary_pe && !atomic_read(&primary_pe->ref_count))
255 - free_pending_exception(primary_pe);
260 diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
261 index f051c6a..7412258 100644
262 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
263 +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
264 @@ -60,7 +60,6 @@ static struct pvr2_hdw *unit_pointers[PVR_NUM] = {[ 0 ... PVR_NUM-1 ] = NULL};
265 static DEFINE_MUTEX(pvr2_unit_mtx);
268 -static int initusbreset = 1;
269 static int procreload;
270 static int tuner[PVR_NUM] = { [0 ... PVR_NUM-1] = -1 };
271 static int tolerance[PVR_NUM] = { [0 ... PVR_NUM-1] = 0 };
272 @@ -71,8 +70,6 @@ module_param(ctlchg, int, S_IRUGO|S_IWUSR);
273 MODULE_PARM_DESC(ctlchg, "0=optimize ctl change 1=always accept new ctl value");
274 module_param(init_pause_msec, int, S_IRUGO|S_IWUSR);
275 MODULE_PARM_DESC(init_pause_msec, "hardware initialization settling delay");
276 -module_param(initusbreset, int, S_IRUGO|S_IWUSR);
277 -MODULE_PARM_DESC(initusbreset, "Do USB reset device on probe");
278 module_param(procreload, int, S_IRUGO|S_IWUSR);
279 MODULE_PARM_DESC(procreload,
280 "Attempt init failure recovery with firmware reload");
281 @@ -1698,9 +1695,6 @@ static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw)
283 hdw->fw1_state = FW1_STATE_OK;
285 - if (initusbreset) {
286 - pvr2_hdw_device_reset(hdw);
288 if (!pvr2_hdw_dev_ok(hdw)) return;
290 for (idx = 0; idx < hdw->hdw_desc->client_modules.cnt; idx++) {
291 diff --git a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c
292 index 54defec..87a68d2 100644
293 --- a/drivers/pci/hotplug/cpqphp_core.c
294 +++ b/drivers/pci/hotplug/cpqphp_core.c
295 @@ -435,7 +435,7 @@ static int ctrl_slot_setup(struct controller *ctrl,
296 slot->number, ctrl->slot_device_offset,
298 result = pci_hp_register(hotplug_slot,
299 - ctrl->pci_dev->subordinate,
300 + ctrl->pci_dev->bus,
303 err("pci_hp_register failed with error %d\n", result);
304 diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c b/drivers/scsi/device_handler/scsi_dh_rdac.c
305 index 6e2f130..d576d4c 100644
306 --- a/drivers/scsi/device_handler/scsi_dh_rdac.c
307 +++ b/drivers/scsi/device_handler/scsi_dh_rdac.c
308 @@ -590,6 +590,8 @@ static const struct scsi_dh_devlist rdac_dev_list[] = {
309 {"STK", "OPENstorage D280"},
311 {"SUN", "LCSM100_F"},
312 + {"DELL", "MD3000"},
313 + {"DELL", "MD3000i"},
317 diff --git a/drivers/usb/atm/speedtch.c b/drivers/usb/atm/speedtch.c
318 index 76fce44..3e86240 100644
319 --- a/drivers/usb/atm/speedtch.c
320 +++ b/drivers/usb/atm/speedtch.c
321 @@ -722,6 +722,16 @@ static void speedtch_atm_stop(struct usbatm_data *usbatm, struct atm_dev *atm_de
322 flush_scheduled_work();
325 +static int speedtch_pre_reset(struct usb_interface *intf)
330 +static int speedtch_post_reset(struct usb_interface *intf)
338 @@ -740,6 +750,8 @@ static struct usb_driver speedtch_usb_driver = {
339 .name = speedtch_driver_name,
340 .probe = speedtch_usb_probe,
341 .disconnect = usbatm_usb_disconnect,
342 + .pre_reset = speedtch_pre_reset,
343 + .post_reset = speedtch_post_reset,
344 .id_table = speedtch_usb_ids
347 diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
348 index c257453..d996a61 100644
349 --- a/drivers/usb/class/cdc-acm.c
350 +++ b/drivers/usb/class/cdc-acm.c
351 @@ -849,9 +849,10 @@ static void acm_write_buffers_free(struct acm *acm)
355 + struct usb_device *usb_dev = interface_to_usbdev(acm->control);
357 for (wb = &acm->wb[0], i = 0; i < ACM_NW; i++, wb++) {
358 - usb_buffer_free(acm->dev, acm->writesize, wb->buf, wb->dmah);
359 + usb_buffer_free(usb_dev, acm->writesize, wb->buf, wb->dmah);
363 diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
364 index 7e8e123..023a4e9 100644
365 --- a/drivers/usb/class/cdc-wdm.c
366 +++ b/drivers/usb/class/cdc-wdm.c
367 @@ -42,6 +42,8 @@ static struct usb_device_id wdm_ids[] = {
371 +MODULE_DEVICE_TABLE (usb, wdm_ids);
373 #define WDM_MINOR_BASE 176
376 diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
377 index 5a7fa6f..9f42cb8 100644
378 --- a/drivers/usb/core/driver.c
379 +++ b/drivers/usb/core/driver.c
380 @@ -1609,7 +1609,8 @@ int usb_external_resume_device(struct usb_device *udev)
381 status = usb_resume_both(udev);
382 udev->last_busy = jiffies;
384 - do_unbind_rebind(udev, DO_REBIND);
386 + do_unbind_rebind(udev, DO_REBIND);
388 /* Now that the device is awake, we can start trying to autosuspend
390 diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
391 index d999638..875de9a 100644
392 --- a/drivers/usb/core/hub.c
393 +++ b/drivers/usb/core/hub.c
394 @@ -3424,7 +3424,7 @@ int usb_reset_device(struct usb_device *udev)
399 + if (ret == 0 && rebind)
400 usb_rebind_intf(cintf);
403 diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
404 index 765adf1..58d5729 100644
405 --- a/fs/cifs/readdir.c
406 +++ b/fs/cifs/readdir.c
407 @@ -762,14 +762,15 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
411 + cifs_save_resume_key(cifsFile->srch_inf.last_entry, cifsFile);
414 while ((index_to_find >= cifsFile->srch_inf.index_of_last_entry) &&
415 (rc == 0) && !cifsFile->srch_inf.endOfSearch) {
416 cFYI(1, ("calling findnext2"));
417 - cifs_save_resume_key(cifsFile->srch_inf.last_entry, cifsFile);
418 rc = CIFSFindNext(xid, pTcon, cifsFile->netfid,
419 &cifsFile->srch_inf);
420 + cifs_save_resume_key(cifsFile->srch_inf.last_entry, cifsFile);
424 diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c
425 index a78c6b4..11a49ce 100644
428 @@ -103,7 +103,7 @@ static int ext2_commit_chunk(struct page *page, loff_t pos, unsigned len)
432 -static void ext2_check_page(struct page *page)
433 +static void ext2_check_page(struct page *page, int quiet)
435 struct inode *dir = page->mapping->host;
436 struct super_block *sb = dir->i_sb;
437 @@ -146,10 +146,10 @@ out:
438 /* Too bad, we had an error */
441 - ext2_error(sb, "ext2_check_page",
442 - "size of directory #%lu is not a multiple of chunk size",
446 + ext2_error(sb, __func__,
447 + "size of directory #%lu is not a multiple "
448 + "of chunk size", dir->i_ino);
451 error = "rec_len is smaller than minimal";
452 @@ -166,32 +166,36 @@ Espan:
454 error = "inode out of bounds";
456 - ext2_error (sb, "ext2_check_page", "bad entry in directory #%lu: %s - "
457 - "offset=%lu, inode=%lu, rec_len=%d, name_len=%d",
458 - dir->i_ino, error, (page->index<<PAGE_CACHE_SHIFT)+offs,
459 - (unsigned long) le32_to_cpu(p->inode),
460 - rec_len, p->name_len);
462 + ext2_error(sb, __func__, "bad entry in directory #%lu: : %s - "
463 + "offset=%lu, inode=%lu, rec_len=%d, name_len=%d",
464 + dir->i_ino, error, (page->index<<PAGE_CACHE_SHIFT)+offs,
465 + (unsigned long) le32_to_cpu(p->inode),
466 + rec_len, p->name_len);
469 - p = (ext2_dirent *)(kaddr + offs);
470 - ext2_error (sb, "ext2_check_page",
471 - "entry in directory #%lu spans the page boundary"
472 - "offset=%lu, inode=%lu",
473 - dir->i_ino, (page->index<<PAGE_CACHE_SHIFT)+offs,
474 - (unsigned long) le32_to_cpu(p->inode));
476 + p = (ext2_dirent *)(kaddr + offs);
477 + ext2_error(sb, "ext2_check_page",
478 + "entry in directory #%lu spans the page boundary"
479 + "offset=%lu, inode=%lu",
480 + dir->i_ino, (page->index<<PAGE_CACHE_SHIFT)+offs,
481 + (unsigned long) le32_to_cpu(p->inode));
484 SetPageChecked(page);
488 -static struct page * ext2_get_page(struct inode *dir, unsigned long n)
489 +static struct page * ext2_get_page(struct inode *dir, unsigned long n,
492 struct address_space *mapping = dir->i_mapping;
493 struct page *page = read_mapping_page(mapping, n, NULL);
496 if (!PageChecked(page))
497 - ext2_check_page(page);
498 + ext2_check_page(page, quiet);
502 @@ -292,7 +296,7 @@ ext2_readdir (struct file * filp, void * dirent, filldir_t filldir)
503 for ( ; n < npages; n++, offset = 0) {
506 - struct page *page = ext2_get_page(inode, n);
507 + struct page *page = ext2_get_page(inode, n, 0);
510 ext2_error(sb, __func__,
511 @@ -361,6 +365,7 @@ struct ext2_dir_entry_2 * ext2_find_entry (struct inode * dir,
512 struct page *page = NULL;
513 struct ext2_inode_info *ei = EXT2_I(dir);
515 + int dir_has_error = 0;
519 @@ -374,7 +379,7 @@ struct ext2_dir_entry_2 * ext2_find_entry (struct inode * dir,
523 - page = ext2_get_page(dir, n);
524 + page = ext2_get_page(dir, n, dir_has_error);
526 kaddr = page_address(page);
527 de = (ext2_dirent *) kaddr;
528 @@ -391,7 +396,9 @@ struct ext2_dir_entry_2 * ext2_find_entry (struct inode * dir,
529 de = ext2_next_entry(de);
538 /* next page is past the blocks we've got */
539 @@ -414,7 +421,7 @@ found:
541 struct ext2_dir_entry_2 * ext2_dotdot (struct inode *dir, struct page **p)
543 - struct page *page = ext2_get_page(dir, 0);
544 + struct page *page = ext2_get_page(dir, 0, 0);
545 ext2_dirent *de = NULL;
548 @@ -487,7 +494,7 @@ int ext2_add_link (struct dentry *dentry, struct inode *inode)
549 for (n = 0; n <= npages; n++) {
552 - page = ext2_get_page(dir, n);
553 + page = ext2_get_page(dir, n, 0);
557 @@ -655,14 +662,17 @@ int ext2_empty_dir (struct inode * inode)
559 struct page *page = NULL;
560 unsigned long i, npages = dir_pages(inode);
561 + int dir_has_error = 0;
563 for (i = 0; i < npages; i++) {
566 - page = ext2_get_page(inode, i);
567 + page = ext2_get_page(inode, i, dir_has_error);
570 + if (IS_ERR(page)) {
575 kaddr = page_address(page);
576 de = (ext2_dirent *)kaddr;
577 diff --git a/fs/ext3/dir.c b/fs/ext3/dir.c
578 index 2eea96e..1b80f1c 100644
581 @@ -102,6 +102,7 @@ static int ext3_readdir(struct file * filp,
583 struct inode *inode = filp->f_path.dentry->d_inode;
585 + int dir_has_error = 0;
589 @@ -148,9 +149,12 @@ static int ext3_readdir(struct file * filp,
590 * of recovering data when there's a bad sector
593 - ext3_error (sb, "ext3_readdir",
594 - "directory #%lu contains a hole at offset %lu",
595 - inode->i_ino, (unsigned long)filp->f_pos);
596 + if (!dir_has_error) {
597 + ext3_error(sb, __func__, "directory #%lu "
598 + "contains a hole at offset %lld",
599 + inode->i_ino, filp->f_pos);
602 /* corrupt size? Maybe no more blocks to read */
603 if (filp->f_pos > inode->i_blocks << 9)
605 diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c
606 index ec8e33b..d1d6487 100644
609 @@ -102,6 +102,7 @@ static int ext4_readdir(struct file * filp,
611 struct inode *inode = filp->f_path.dentry->d_inode;
613 + int dir_has_error = 0;
617 @@ -148,9 +149,13 @@ static int ext4_readdir(struct file * filp,
618 * of recovering data when there's a bad sector
621 - ext4_error (sb, "ext4_readdir",
622 - "directory #%lu contains a hole at offset %lu",
623 - inode->i_ino, (unsigned long)filp->f_pos);
624 + if (!dir_has_error) {
625 + ext4_error(sb, __func__, "directory #%lu "
626 + "contains a hole at offset %Lu",
628 + (unsigned long long) filp->f_pos);
631 /* corrupt size? Maybe no more blocks to read */
632 if (filp->f_pos > inode->i_blocks << 9)
634 diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
635 index 73d1891..f3ada04 100644
636 --- a/fs/proc/task_mmu.c
637 +++ b/fs/proc/task_mmu.c
638 @@ -198,11 +198,8 @@ static int do_maps_open(struct inode *inode, struct file *file,
642 -static int show_map(struct seq_file *m, void *v)
643 +static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
645 - struct proc_maps_private *priv = m->private;
646 - struct task_struct *task = priv->task;
647 - struct vm_area_struct *vma = v;
648 struct mm_struct *mm = vma->vm_mm;
649 struct file *file = vma->vm_file;
650 int flags = vma->vm_flags;
651 @@ -210,9 +207,6 @@ static int show_map(struct seq_file *m, void *v)
655 - if (maps_protect && !ptrace_may_access(task, PTRACE_MODE_READ))
659 struct inode *inode = vma->vm_file->f_path.dentry->d_inode;
660 dev = inode->i_sb->s_dev;
661 @@ -257,6 +251,18 @@ static int show_map(struct seq_file *m, void *v)
667 +static int show_map(struct seq_file *m, void *v)
669 + struct vm_area_struct *vma = v;
670 + struct proc_maps_private *priv = m->private;
671 + struct task_struct *task = priv->task;
673 + if (maps_protect && !ptrace_may_access(task, PTRACE_MODE_READ))
676 + show_map_vma(m, vma);
678 if (m->count < m->size) /* vma is copied successfully */
679 m->version = (vma != get_gate_vma(task))? vma->vm_start: 0;
680 @@ -367,23 +373,25 @@ static int smaps_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
682 static int show_smap(struct seq_file *m, void *v)
684 + struct proc_maps_private *priv = m->private;
685 + struct task_struct *task = priv->task;
686 struct vm_area_struct *vma = v;
687 struct mem_size_stats mss;
689 struct mm_walk smaps_walk = {
690 .pmd_entry = smaps_pte_range,
695 + if (maps_protect && !ptrace_may_access(task, PTRACE_MODE_READ))
698 memset(&mss, 0, sizeof mss);
700 if (vma->vm_mm && !is_vm_hugetlb_page(vma))
701 walk_page_range(vma->vm_start, vma->vm_end, &smaps_walk);
703 - ret = show_map(m, v);
706 + show_map_vma(m, vma);
710 @@ -405,7 +413,9 @@ static int show_smap(struct seq_file *m, void *v)
711 mss.referenced >> 10,
715 + if (m->count < m->size) /* vma is copied successfully */
716 + m->version = (vma != get_gate_vma(task)) ? vma->vm_start : 0;
720 static const struct seq_operations proc_pid_smaps_op = {
721 diff --git a/kernel/sched_stats.h b/kernel/sched_stats.h
722 index 8385d43..81365b3 100644
723 --- a/kernel/sched_stats.h
724 +++ b/kernel/sched_stats.h
726 static int show_schedstat(struct seq_file *seq, void *v)
729 - int mask_len = NR_CPUS/32 * 9;
730 + int mask_len = (NR_CPUS/32 + 1) * 9;
731 char *mask_str = kmalloc(mask_len, GFP_KERNEL);
733 if (mask_str == NULL)
734 diff --git a/mm/rmap.c b/mm/rmap.c
735 index 0383acf..e8d639b 100644
740 struct kmem_cache *anon_vma_cachep;
742 -/* This must be called under the mmap_sem. */
744 + * anon_vma_prepare - attach an anon_vma to a memory region
745 + * @vma: the memory region in question
747 + * This makes sure the memory mapping described by 'vma' has
748 + * an 'anon_vma' attached to it, so that we can associate the
749 + * anonymous pages mapped into it with that anon_vma.
751 + * The common case will be that we already have one, but if
752 + * if not we either need to find an adjacent mapping that we
753 + * can re-use the anon_vma from (very common when the only
754 + * reason for splitting a vma has been mprotect()), or we
755 + * allocate a new one.
757 + * Anon-vma allocations are very subtle, because we may have
758 + * optimistically looked up an anon_vma in page_lock_anon_vma()
759 + * and that may actually touch the spinlock even in the newly
760 + * allocated vma (it depends on RCU to make sure that the
761 + * anon_vma isn't actually destroyed).
763 + * As a result, we need to do proper anon_vma locking even
764 + * for the new allocation. At the same time, we do not want
765 + * to do any locking for the common case of already having
768 + * This must be called with the mmap_sem held for reading.
770 int anon_vma_prepare(struct vm_area_struct *vma)
772 struct anon_vma *anon_vma = vma->anon_vma;
773 @@ -63,20 +89,17 @@ int anon_vma_prepare(struct vm_area_struct *vma)
775 if (unlikely(!anon_vma)) {
776 struct mm_struct *mm = vma->vm_mm;
777 - struct anon_vma *allocated, *locked;
778 + struct anon_vma *allocated;
780 anon_vma = find_mergeable_anon_vma(vma);
784 - spin_lock(&locked->lock);
788 anon_vma = anon_vma_alloc();
789 if (unlikely(!anon_vma))
791 allocated = anon_vma;
794 + spin_lock(&anon_vma->lock);
796 /* page_table_lock to protect against threads */
797 spin_lock(&mm->page_table_lock);
798 @@ -87,8 +110,7 @@ int anon_vma_prepare(struct vm_area_struct *vma)
800 spin_unlock(&mm->page_table_lock);
803 - spin_unlock(&locked->lock);
804 + spin_unlock(&anon_vma->lock);
805 if (unlikely(allocated))
806 anon_vma_free(allocated);
808 diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
809 index 5a955c4..7eb0b61 100644
810 --- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
811 +++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
812 @@ -150,10 +150,12 @@ static unsigned int ipv4_conntrack_defrag(unsigned int hooknum,
813 const struct net_device *out,
814 int (*okfn)(struct sk_buff *))
816 +#if !defined(CONFIG_NF_NAT) && !defined(CONFIG_NF_NAT_MODULE)
817 /* Previously seen (loopback)? Ignore. Do this before
823 /* Gather fragments. */
824 if (ip_hdr(skb)->frag_off & htons(IP_MF | IP_OFFSET)) {
825 diff --git a/net/ipv4/netfilter/nf_nat_snmp_basic.c b/net/ipv4/netfilter/nf_nat_snmp_basic.c
826 index ffeaffc..8303e4b 100644
827 --- a/net/ipv4/netfilter/nf_nat_snmp_basic.c
828 +++ b/net/ipv4/netfilter/nf_nat_snmp_basic.c
829 @@ -742,6 +742,7 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
830 *obj = kmalloc(sizeof(struct snmp_object) + len,
836 printk("OOM in bsalg (%d)\n", __LINE__);
837 diff --git a/net/netfilter/xt_iprange.c b/net/netfilter/xt_iprange.c
838 index c63e933..4b5741b 100644
839 --- a/net/netfilter/xt_iprange.c
840 +++ b/net/netfilter/xt_iprange.c
841 @@ -67,7 +67,7 @@ iprange_mt4(const struct sk_buff *skb, const struct net_device *in,
842 if (info->flags & IPRANGE_SRC) {
843 m = ntohl(iph->saddr) < ntohl(info->src_min.ip);
844 m |= ntohl(iph->saddr) > ntohl(info->src_max.ip);
845 - m ^= info->flags & IPRANGE_SRC_INV;
846 + m ^= !!(info->flags & IPRANGE_SRC_INV);
848 pr_debug("src IP " NIPQUAD_FMT " NOT in range %s"
849 NIPQUAD_FMT "-" NIPQUAD_FMT "\n",
850 @@ -81,7 +81,7 @@ iprange_mt4(const struct sk_buff *skb, const struct net_device *in,
851 if (info->flags & IPRANGE_DST) {
852 m = ntohl(iph->daddr) < ntohl(info->dst_min.ip);
853 m |= ntohl(iph->daddr) > ntohl(info->dst_max.ip);
854 - m ^= info->flags & IPRANGE_DST_INV;
855 + m ^= !!(info->flags & IPRANGE_DST_INV);
857 pr_debug("dst IP " NIPQUAD_FMT " NOT in range %s"
858 NIPQUAD_FMT "-" NIPQUAD_FMT "\n",
859 @@ -123,14 +123,14 @@ iprange_mt6(const struct sk_buff *skb, const struct net_device *in,
860 if (info->flags & IPRANGE_SRC) {
861 m = iprange_ipv6_sub(&iph->saddr, &info->src_min.in6) < 0;
862 m |= iprange_ipv6_sub(&iph->saddr, &info->src_max.in6) > 0;
863 - m ^= info->flags & IPRANGE_SRC_INV;
864 + m ^= !!(info->flags & IPRANGE_SRC_INV);
868 if (info->flags & IPRANGE_DST) {
869 m = iprange_ipv6_sub(&iph->daddr, &info->dst_min.in6) < 0;
870 m |= iprange_ipv6_sub(&iph->daddr, &info->dst_max.in6) > 0;
871 - m ^= info->flags & IPRANGE_DST_INV;
872 + m ^= !!(info->flags & IPRANGE_DST_INV);