aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MAINTAINERS10
-rw-r--r--arch/i386/pci/irq.c4
-rw-r--r--arch/ia64/mm/hugetlbpage.c4
-rw-r--r--arch/powerpc/mm/hugetlbpage.c8
-rw-r--r--drivers/ata/libata-core.c2
-rw-r--r--drivers/block/cciss.c6
-rw-r--r--drivers/block/cpqarray.c15
-rw-r--r--drivers/ide/legacy/hd.c2
-rw-r--r--drivers/pci/quirks.c27
-rw-r--r--drivers/video/nvidia/nv_setup.c2
-rw-r--r--fs/autofs/inode.c14
-rw-r--r--fs/autofs/waitq.c1
-rw-r--r--fs/autofs4/inode.c17
-rw-r--r--fs/autofs4/waitq.c6
-rw-r--r--fs/hugetlbfs/inode.c21
-rw-r--r--include/linux/hugetlb.h10
-rw-r--r--kernel/irq/manage.c9
-rw-r--r--mm/mmap.c5
18 files changed, 98 insertions, 65 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 8732daeae303..a5508f930ed9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3072,6 +3072,13 @@ L: video4linux-list@redhat.com
3072W: http://www.linux-projects.org 3072W: http://www.linux-projects.org
3073S: Maintained 3073S: Maintained
3074 3074
3075USB GADGET/PERIPHERAL SUBSYSTEM
3076P: David Brownell
3077M: dbrownell@users.sourceforge.net
3078L: linux-usb-devel@lists.sourceforge.net
3079W: http://www.linux-usb.org/gadget
3080S: Maintained
3081
3075USB HID/HIDBP DRIVERS 3082USB HID/HIDBP DRIVERS
3076P: Vojtech Pavlik 3083P: Vojtech Pavlik
3077M: vojtech@suse.cz 3084M: vojtech@suse.cz
@@ -3255,10 +3262,11 @@ L: linux-usb-users@lists.sourceforge.net
3255L: linux-usb-devel@lists.sourceforge.net 3262L: linux-usb-devel@lists.sourceforge.net
3256S: Maintained 3263S: Maintained
3257 3264
3258USB "USBNET" DRIVER 3265USB "USBNET" DRIVER FRAMEWORK
3259P: David Brownell 3266P: David Brownell
3260M: dbrownell@users.sourceforge.net 3267M: dbrownell@users.sourceforge.net
3261L: linux-usb-devel@lists.sourceforge.net 3268L: linux-usb-devel@lists.sourceforge.net
3269W: http://www.linux-usb.org/usbnet
3262S: Maintained 3270S: Maintained
3263 3271
3264USB W996[87]CF DRIVER 3272USB W996[87]CF DRIVER
diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c
index dbc4aae91959..69163998adeb 100644
--- a/arch/i386/pci/irq.c
+++ b/arch/i386/pci/irq.c
@@ -255,13 +255,13 @@ static int pirq_via_set(struct pci_dev *router, struct pci_dev *dev, int pirq, i
255 */ 255 */
256static int pirq_via586_get(struct pci_dev *router, struct pci_dev *dev, int pirq) 256static int pirq_via586_get(struct pci_dev *router, struct pci_dev *dev, int pirq)
257{ 257{
258 static const unsigned int pirqmap[4] = { 3, 2, 5, 1 }; 258 static const unsigned int pirqmap[5] = { 3, 2, 5, 1, 1 };
259 return read_config_nybble(router, 0x55, pirqmap[pirq-1]); 259 return read_config_nybble(router, 0x55, pirqmap[pirq-1]);
260} 260}
261 261
262static int pirq_via586_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) 262static int pirq_via586_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq)
263{ 263{
264 static const unsigned int pirqmap[4] = { 3, 2, 5, 1 }; 264 static const unsigned int pirqmap[5] = { 3, 2, 5, 1, 1 };
265 write_config_nybble(router, 0x55, pirqmap[pirq-1], irq); 265 write_config_nybble(router, 0x55, pirqmap[pirq-1], irq);
266 return 1; 266 return 1;
267} 267}
diff --git a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c
index eee5c1cfbe32..f3a9585e98a8 100644
--- a/arch/ia64/mm/hugetlbpage.c
+++ b/arch/ia64/mm/hugetlbpage.c
@@ -70,8 +70,10 @@ huge_pte_offset (struct mm_struct *mm, unsigned long addr)
70 * Don't actually need to do any preparation, but need to make sure 70 * Don't actually need to do any preparation, but need to make sure
71 * the address is in the right region. 71 * the address is in the right region.
72 */ 72 */
73int prepare_hugepage_range(unsigned long addr, unsigned long len) 73int prepare_hugepage_range(unsigned long addr, unsigned long len, pgoff_t pgoff)
74{ 74{
75 if (pgoff & (~HPAGE_MASK >> PAGE_SHIFT))
76 return -EINVAL;
75 if (len & ~HPAGE_MASK) 77 if (len & ~HPAGE_MASK)
76 return -EINVAL; 78 return -EINVAL;
77 if (addr & ~HPAGE_MASK) 79 if (addr & ~HPAGE_MASK)
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index fd68b74c07c3..506d89768d45 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -491,11 +491,15 @@ static int open_high_hpage_areas(struct mm_struct *mm, u16 newareas)
491 return 0; 491 return 0;
492} 492}
493 493
494int prepare_hugepage_range(unsigned long addr, unsigned long len) 494int prepare_hugepage_range(unsigned long addr, unsigned long len, pgoff_t pgoff)
495{ 495{
496 int err = 0; 496 int err = 0;
497 497
498 if ( (addr+len) < addr ) 498 if (pgoff & (~HPAGE_MASK >> PAGE_SHIFT))
499 return -EINVAL;
500 if (len & ~HPAGE_MASK)
501 return -EINVAL;
502 if (addr & ~HPAGE_MASK)
499 return -EINVAL; 503 return -EINVAL;
500 504
501 if (addr < 0x100000000UL) 505 if (addr < 0x100000000UL)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index a8fd0c3e59b3..915a55a6cc14 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5957,7 +5957,7 @@ static void __exit ata_exit(void)
5957 destroy_workqueue(ata_aux_wq); 5957 destroy_workqueue(ata_aux_wq);
5958} 5958}
5959 5959
5960module_init(ata_init); 5960subsys_initcall(ata_init);
5961module_exit(ata_exit); 5961module_exit(ata_exit);
5962 5962
5963static unsigned long ratelimit_time; 5963static unsigned long ratelimit_time;
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 6ffe2b2bdacc..4105c3bf3476 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1300,6 +1300,12 @@ static void cciss_softirq_done(struct request *rq)
1300 1300
1301 complete_buffers(rq->bio, rq->errors); 1301 complete_buffers(rq->bio, rq->errors);
1302 1302
1303 if (blk_fs_request(rq)) {
1304 const int rw = rq_data_dir(rq);
1305
1306 disk_stat_add(rq->rq_disk, sectors[rw], rq->nr_sectors);
1307 }
1308
1303#ifdef CCISS_DEBUG 1309#ifdef CCISS_DEBUG
1304 printk("Done with %p\n", rq); 1310 printk("Done with %p\n", rq);
1305#endif /* CCISS_DEBUG */ 1311#endif /* CCISS_DEBUG */
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
index 570d2f049323..d5f519ebbc08 100644
--- a/drivers/block/cpqarray.c
+++ b/drivers/block/cpqarray.c
@@ -998,6 +998,7 @@ static inline void complete_buffers(struct bio *bio, int ok)
998 */ 998 */
999static inline void complete_command(cmdlist_t *cmd, int timeout) 999static inline void complete_command(cmdlist_t *cmd, int timeout)
1000{ 1000{
1001 struct request *rq = cmd->rq;
1001 int ok=1; 1002 int ok=1;
1002 int i, ddir; 1003 int i, ddir;
1003 1004
@@ -1029,12 +1030,18 @@ static inline void complete_command(cmdlist_t *cmd, int timeout)
1029 pci_unmap_page(hba[cmd->ctlr]->pci_dev, cmd->req.sg[i].addr, 1030 pci_unmap_page(hba[cmd->ctlr]->pci_dev, cmd->req.sg[i].addr,
1030 cmd->req.sg[i].size, ddir); 1031 cmd->req.sg[i].size, ddir);
1031 1032
1032 complete_buffers(cmd->rq->bio, ok); 1033 complete_buffers(rq->bio, ok);
1033 1034
1034 add_disk_randomness(cmd->rq->rq_disk); 1035 if (blk_fs_request(rq)) {
1036 const int rw = rq_data_dir(rq);
1035 1037
1036 DBGPX(printk("Done with %p\n", cmd->rq);); 1038 disk_stat_add(rq->rq_disk, sectors[rw], rq->nr_sectors);
1037 end_that_request_last(cmd->rq, ok ? 1 : -EIO); 1039 }
1040
1041 add_disk_randomness(rq->rq_disk);
1042
1043 DBGPX(printk("Done with %p\n", rq););
1044 end_that_request_last(rq, ok ? 1 : -EIO);
1038} 1045}
1039 1046
1040/* 1047/*
diff --git a/drivers/ide/legacy/hd.c b/drivers/ide/legacy/hd.c
index b1d5291531b7..45ed03591cd8 100644
--- a/drivers/ide/legacy/hd.c
+++ b/drivers/ide/legacy/hd.c
@@ -459,7 +459,7 @@ ok_to_read:
459#ifdef DEBUG 459#ifdef DEBUG
460 printk("%s: read: sector %ld, remaining = %ld, buffer=%p\n", 460 printk("%s: read: sector %ld, remaining = %ld, buffer=%p\n",
461 req->rq_disk->disk_name, req->sector, req->nr_sectors, 461 req->rq_disk->disk_name, req->sector, req->nr_sectors,
462 req->buffer+512)); 462 req->buffer+512);
463#endif 463#endif
464 if (req->current_nr_sectors <= 0) 464 if (req->current_nr_sectors <= 0)
465 end_request(req, 1); 465 end_request(req, 1);
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 204b1c8e972b..5b4483811691 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -1460,33 +1460,6 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2609, quirk_intel_pcie_pm);
1460DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260a, quirk_intel_pcie_pm); 1460DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260a, quirk_intel_pcie_pm);
1461DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260b, quirk_intel_pcie_pm); 1461DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260b, quirk_intel_pcie_pm);
1462 1462
1463/*
1464 * Fixup the cardbus bridges on the IBM Dock II docking station
1465 */
1466static void __devinit quirk_ibm_dock2_cardbus(struct pci_dev *dev)
1467{
1468 u32 val;
1469
1470 /*
1471 * tie the 2 interrupt pins to INTA, and configure the
1472 * multifunction routing register to handle this.
1473 */
1474 if ((dev->subsystem_vendor == PCI_VENDOR_ID_IBM) &&
1475 (dev->subsystem_device == 0x0148)) {
1476 printk(KERN_INFO "PCI: Found IBM Dock II Cardbus Bridge "
1477 "applying quirk\n");
1478 pci_read_config_dword(dev, 0x8c, &val);
1479 val = ((val & 0xffffff00) | 0x1002);
1480 pci_write_config_dword(dev, 0x8c, val);
1481 pci_read_config_dword(dev, 0x80, &val);
1482 val = ((val & 0x00ffff00) | 0x2864c077);
1483 pci_write_config_dword(dev, 0x80, val);
1484 }
1485}
1486
1487DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1420,
1488 quirk_ibm_dock2_cardbus);
1489
1490static void __devinit quirk_netmos(struct pci_dev *dev) 1463static void __devinit quirk_netmos(struct pci_dev *dev)
1491{ 1464{
1492 unsigned int num_parallel = (dev->subsystem_device & 0xf0) >> 4; 1465 unsigned int num_parallel = (dev->subsystem_device & 0xf0) >> 4;
diff --git a/drivers/video/nvidia/nv_setup.c b/drivers/video/nvidia/nv_setup.c
index 61dc46fecf2b..eab3e282a4de 100644
--- a/drivers/video/nvidia/nv_setup.c
+++ b/drivers/video/nvidia/nv_setup.c
@@ -262,7 +262,7 @@ static void nv10GetConfig(struct nvidia_par *par)
262#endif 262#endif
263 263
264 dev = pci_find_slot(0, 1); 264 dev = pci_find_slot(0, 1);
265 if ((par->Chipset && 0xffff) == 0x01a0) { 265 if ((par->Chipset & 0xffff) == 0x01a0) {
266 int amt = 0; 266 int amt = 0;
267 267
268 pci_read_config_dword(dev, 0x7c, &amt); 268 pci_read_config_dword(dev, 0x7c, &amt);
diff --git a/fs/autofs/inode.c b/fs/autofs/inode.c
index 54c518c89e4c..38ede5c9d6fd 100644
--- a/fs/autofs/inode.c
+++ b/fs/autofs/inode.c
@@ -25,6 +25,14 @@ void autofs_kill_sb(struct super_block *sb)
25 struct autofs_sb_info *sbi = autofs_sbi(sb); 25 struct autofs_sb_info *sbi = autofs_sbi(sb);
26 unsigned int n; 26 unsigned int n;
27 27
28 /*
29 * In the event of a failure in get_sb_nodev the superblock
30 * info is not present so nothing else has been setup, so
31 * just exit when we are called from deactivate_super.
32 */
33 if (!sbi)
34 return;
35
28 if ( !sbi->catatonic ) 36 if ( !sbi->catatonic )
29 autofs_catatonic_mode(sbi); /* Free wait queues, close pipe */ 37 autofs_catatonic_mode(sbi); /* Free wait queues, close pipe */
30 38
@@ -136,7 +144,8 @@ int autofs_fill_super(struct super_block *s, void *data, int silent)
136 144
137 s->s_fs_info = sbi; 145 s->s_fs_info = sbi;
138 sbi->magic = AUTOFS_SBI_MAGIC; 146 sbi->magic = AUTOFS_SBI_MAGIC;
139 sbi->catatonic = 0; 147 sbi->pipe = NULL;
148 sbi->catatonic = 1;
140 sbi->exp_timeout = 0; 149 sbi->exp_timeout = 0;
141 sbi->oz_pgrp = process_group(current); 150 sbi->oz_pgrp = process_group(current);
142 autofs_initialize_hash(&sbi->dirhash); 151 autofs_initialize_hash(&sbi->dirhash);
@@ -180,6 +189,7 @@ int autofs_fill_super(struct super_block *s, void *data, int silent)
180 if ( !pipe->f_op || !pipe->f_op->write ) 189 if ( !pipe->f_op || !pipe->f_op->write )
181 goto fail_fput; 190 goto fail_fput;
182 sbi->pipe = pipe; 191 sbi->pipe = pipe;
192 sbi->catatonic = 0;
183 193
184 /* 194 /*
185 * Success! Install the root dentry now to indicate completion. 195 * Success! Install the root dentry now to indicate completion.
@@ -198,6 +208,8 @@ fail_iput:
198 iput(root_inode); 208 iput(root_inode);
199fail_free: 209fail_free:
200 kfree(sbi); 210 kfree(sbi);
211 s->s_fs_info = NULL;
212 kill_anon_super(s);
201fail_unlock: 213fail_unlock:
202 return -EINVAL; 214 return -EINVAL;
203} 215}
diff --git a/fs/autofs/waitq.c b/fs/autofs/waitq.c
index 633f628005b4..19a9cafb5ddf 100644
--- a/fs/autofs/waitq.c
+++ b/fs/autofs/waitq.c
@@ -41,6 +41,7 @@ void autofs_catatonic_mode(struct autofs_sb_info *sbi)
41 wq = nwq; 41 wq = nwq;
42 } 42 }
43 fput(sbi->pipe); /* Close the pipe */ 43 fput(sbi->pipe); /* Close the pipe */
44 sbi->pipe = NULL;
44 autofs_hash_dputall(&sbi->dirhash); /* Remove all dentry pointers */ 45 autofs_hash_dputall(&sbi->dirhash); /* Remove all dentry pointers */
45} 46}
46 47
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c
index 51fd8595bf85..ce7c0f1dd529 100644
--- a/fs/autofs4/inode.c
+++ b/fs/autofs4/inode.c
@@ -99,6 +99,9 @@ static void autofs4_force_release(struct autofs_sb_info *sbi)
99 struct dentry *this_parent = sbi->sb->s_root; 99 struct dentry *this_parent = sbi->sb->s_root;
100 struct list_head *next; 100 struct list_head *next;
101 101
102 if (!sbi->sb->s_root)
103 return;
104
102 spin_lock(&dcache_lock); 105 spin_lock(&dcache_lock);
103repeat: 106repeat:
104 next = this_parent->d_subdirs.next; 107 next = this_parent->d_subdirs.next;
@@ -146,6 +149,14 @@ void autofs4_kill_sb(struct super_block *sb)
146{ 149{
147 struct autofs_sb_info *sbi = autofs4_sbi(sb); 150 struct autofs_sb_info *sbi = autofs4_sbi(sb);
148 151
152 /*
153 * In the event of a failure in get_sb_nodev the superblock
154 * info is not present so nothing else has been setup, so
155 * just exit when we are called from deactivate_super.
156 */
157 if (!sbi)
158 return;
159
149 sb->s_fs_info = NULL; 160 sb->s_fs_info = NULL;
150 161
151 if ( !sbi->catatonic ) 162 if ( !sbi->catatonic )
@@ -310,7 +321,8 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
310 s->s_fs_info = sbi; 321 s->s_fs_info = sbi;
311 sbi->magic = AUTOFS_SBI_MAGIC; 322 sbi->magic = AUTOFS_SBI_MAGIC;
312 sbi->pipefd = -1; 323 sbi->pipefd = -1;
313 sbi->catatonic = 0; 324 sbi->pipe = NULL;
325 sbi->catatonic = 1;
314 sbi->exp_timeout = 0; 326 sbi->exp_timeout = 0;
315 sbi->oz_pgrp = process_group(current); 327 sbi->oz_pgrp = process_group(current);
316 sbi->sb = s; 328 sbi->sb = s;
@@ -388,6 +400,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
388 goto fail_fput; 400 goto fail_fput;
389 sbi->pipe = pipe; 401 sbi->pipe = pipe;
390 sbi->pipefd = pipefd; 402 sbi->pipefd = pipefd;
403 sbi->catatonic = 0;
391 404
392 /* 405 /*
393 * Success! Install the root dentry now to indicate completion. 406 * Success! Install the root dentry now to indicate completion.
@@ -412,6 +425,8 @@ fail_ino:
412 kfree(ino); 425 kfree(ino);
413fail_free: 426fail_free:
414 kfree(sbi); 427 kfree(sbi);
428 s->s_fs_info = NULL;
429 kill_anon_super(s);
415fail_unlock: 430fail_unlock:
416 return -EINVAL; 431 return -EINVAL;
417} 432}
diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
index c0a6c8d445c7..1e4a539f4417 100644
--- a/fs/autofs4/waitq.c
+++ b/fs/autofs4/waitq.c
@@ -41,10 +41,8 @@ void autofs4_catatonic_mode(struct autofs_sb_info *sbi)
41 wake_up_interruptible(&wq->queue); 41 wake_up_interruptible(&wq->queue);
42 wq = nwq; 42 wq = nwq;
43 } 43 }
44 if (sbi->pipe) { 44 fput(sbi->pipe); /* Close the pipe */
45 fput(sbi->pipe); /* Close the pipe */ 45 sbi->pipe = NULL;
46 sbi->pipe = NULL;
47 }
48} 46}
49 47
50static int autofs4_write(struct file *file, const void *addr, int bytes) 48static int autofs4_write(struct file *file, const void *addr, int bytes)
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 0bea6a619e10..7f4756963d05 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -62,24 +62,19 @@ static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma)
62 loff_t len, vma_len; 62 loff_t len, vma_len;
63 int ret; 63 int ret;
64 64
65 if (vma->vm_pgoff & (HPAGE_SIZE / PAGE_SIZE - 1)) 65 /*
66 return -EINVAL; 66 * vma alignment has already been checked by prepare_hugepage_range.
67 67 * If you add any error returns here, do so after setting VM_HUGETLB,
68 if (vma->vm_start & ~HPAGE_MASK) 68 * so is_vm_hugetlb_page tests below unmap_region go the right way
69 return -EINVAL; 69 * when do_mmap_pgoff unwinds (may be important on powerpc and ia64).
70 70 */
71 if (vma->vm_end & ~HPAGE_MASK) 71 vma->vm_flags |= VM_HUGETLB | VM_RESERVED;
72 return -EINVAL; 72 vma->vm_ops = &hugetlb_vm_ops;
73
74 if (vma->vm_end - vma->vm_start < HPAGE_SIZE)
75 return -EINVAL;
76 73
77 vma_len = (loff_t)(vma->vm_end - vma->vm_start); 74 vma_len = (loff_t)(vma->vm_end - vma->vm_start);
78 75
79 mutex_lock(&inode->i_mutex); 76 mutex_lock(&inode->i_mutex);
80 file_accessed(file); 77 file_accessed(file);
81 vma->vm_flags |= VM_HUGETLB | VM_RESERVED;
82 vma->vm_ops = &hugetlb_vm_ops;
83 78
84 ret = -ENOMEM; 79 ret = -ENOMEM;
85 len = vma_len + ((loff_t)vma->vm_pgoff << PAGE_SHIFT); 80 len = vma_len + ((loff_t)vma->vm_pgoff << PAGE_SHIFT);
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 5081d27bfa27..ace64e57e17f 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -60,8 +60,11 @@ void hugetlb_free_pgd_range(struct mmu_gather **tlb, unsigned long addr,
60 * If the arch doesn't supply something else, assume that hugepage 60 * If the arch doesn't supply something else, assume that hugepage
61 * size aligned regions are ok without further preparation. 61 * size aligned regions are ok without further preparation.
62 */ 62 */
63static inline int prepare_hugepage_range(unsigned long addr, unsigned long len) 63static inline int prepare_hugepage_range(unsigned long addr, unsigned long len,
64 pgoff_t pgoff)
64{ 65{
66 if (pgoff & (~HPAGE_MASK >> PAGE_SHIFT))
67 return -EINVAL;
65 if (len & ~HPAGE_MASK) 68 if (len & ~HPAGE_MASK)
66 return -EINVAL; 69 return -EINVAL;
67 if (addr & ~HPAGE_MASK) 70 if (addr & ~HPAGE_MASK)
@@ -69,7 +72,8 @@ static inline int prepare_hugepage_range(unsigned long addr, unsigned long len)
69 return 0; 72 return 0;
70} 73}
71#else 74#else
72int prepare_hugepage_range(unsigned long addr, unsigned long len); 75int prepare_hugepage_range(unsigned long addr, unsigned long len,
76 pgoff_t pgoff);
73#endif 77#endif
74 78
75#ifndef ARCH_HAS_SETCLEAR_HUGE_PTE 79#ifndef ARCH_HAS_SETCLEAR_HUGE_PTE
@@ -107,7 +111,7 @@ static inline unsigned long hugetlb_total_pages(void)
107#define hugetlb_report_meminfo(buf) 0 111#define hugetlb_report_meminfo(buf) 0
108#define hugetlb_report_node_meminfo(n, buf) 0 112#define hugetlb_report_node_meminfo(n, buf) 0
109#define follow_huge_pmd(mm, addr, pmd, write) NULL 113#define follow_huge_pmd(mm, addr, pmd, write) NULL
110#define prepare_hugepage_range(addr, len) (-EINVAL) 114#define prepare_hugepage_range(addr,len,pgoff) (-EINVAL)
111#define pmd_huge(x) 0 115#define pmd_huge(x) 0
112#define is_hugepage_only_range(mm, addr, len) 0 116#define is_hugepage_only_range(mm, addr, len) 0
113#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) 117#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; })
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 6879202afe9a..b385878c6e80 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -216,6 +216,7 @@ int setup_irq(unsigned int irq, struct irqaction *new)
216{ 216{
217 struct irq_desc *desc = irq_desc + irq; 217 struct irq_desc *desc = irq_desc + irq;
218 struct irqaction *old, **p; 218 struct irqaction *old, **p;
219 const char *old_name = NULL;
219 unsigned long flags; 220 unsigned long flags;
220 int shared = 0; 221 int shared = 0;
221 222
@@ -255,8 +256,10 @@ int setup_irq(unsigned int irq, struct irqaction *new)
255 * set the trigger type must match. 256 * set the trigger type must match.
256 */ 257 */
257 if (!((old->flags & new->flags) & IRQF_SHARED) || 258 if (!((old->flags & new->flags) & IRQF_SHARED) ||
258 ((old->flags ^ new->flags) & IRQF_TRIGGER_MASK)) 259 ((old->flags ^ new->flags) & IRQF_TRIGGER_MASK)) {
260 old_name = old->name;
259 goto mismatch; 261 goto mismatch;
262 }
260 263
261#if defined(CONFIG_IRQ_PER_CPU) 264#if defined(CONFIG_IRQ_PER_CPU)
262 /* All handlers must agree on per-cpuness */ 265 /* All handlers must agree on per-cpuness */
@@ -322,11 +325,13 @@ int setup_irq(unsigned int irq, struct irqaction *new)
322 return 0; 325 return 0;
323 326
324mismatch: 327mismatch:
325 spin_unlock_irqrestore(&desc->lock, flags);
326 if (!(new->flags & IRQF_PROBE_SHARED)) { 328 if (!(new->flags & IRQF_PROBE_SHARED)) {
327 printk(KERN_ERR "IRQ handler type mismatch for IRQ %d\n", irq); 329 printk(KERN_ERR "IRQ handler type mismatch for IRQ %d\n", irq);
330 if (old_name)
331 printk(KERN_ERR "current handler: %s\n", old_name);
328 dump_stack(); 332 dump_stack();
329 } 333 }
334 spin_unlock_irqrestore(&desc->lock, flags);
330 return -EBUSY; 335 return -EBUSY;
331} 336}
332 337
diff --git a/mm/mmap.c b/mm/mmap.c
index 497e502dfd6b..7b40abd7cba2 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1379,7 +1379,7 @@ get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
1379 * Check if the given range is hugepage aligned, and 1379 * Check if the given range is hugepage aligned, and
1380 * can be made suitable for hugepages. 1380 * can be made suitable for hugepages.
1381 */ 1381 */
1382 ret = prepare_hugepage_range(addr, len); 1382 ret = prepare_hugepage_range(addr, len, pgoff);
1383 } else { 1383 } else {
1384 /* 1384 /*
1385 * Ensure that a normal request is not falling in a 1385 * Ensure that a normal request is not falling in a
@@ -1880,6 +1880,9 @@ unsigned long do_brk(unsigned long addr, unsigned long len)
1880 if ((addr + len) > TASK_SIZE || (addr + len) < addr) 1880 if ((addr + len) > TASK_SIZE || (addr + len) < addr)
1881 return -EINVAL; 1881 return -EINVAL;
1882 1882
1883 if (is_hugepage_only_range(mm, addr, len))
1884 return -EINVAL;
1885
1883 flags = VM_DATA_DEFAULT_FLAGS | VM_ACCOUNT | mm->def_flags; 1886 flags = VM_DATA_DEFAULT_FLAGS | VM_ACCOUNT | mm->def_flags;
1884 1887
1885 error = arch_mmap_check(addr, len, flags); 1888 error = arch_mmap_check(addr, len, flags);