diff options
author | Tim Yamin <plasmaroo@gentoo.org> | 2005-04-13 19:32:40 +0000 |
---|---|---|
committer | Tim Yamin <plasmaroo@gentoo.org> | 2005-04-13 19:32:40 +0000 |
commit | a0fb48b5a88bd2d80c3a249652cbb40d4cb37dbf (patch) | |
tree | e669bf96c7670fbb9517ef151397a42da94c45f2 /sys-kernel | |
parent | Changed to SLOT=2.4, thanks to Sudrien <sudrien@fusemail.com> for spotting wr... (diff) | |
download | gentoo-2-a0fb48b5a88bd2d80c3a249652cbb40d4cb37dbf.tar.gz gentoo-2-a0fb48b5a88bd2d80c3a249652cbb40d4cb37dbf.tar.bz2 gentoo-2-a0fb48b5a88bd2d80c3a249652cbb40d4cb37dbf.zip |
Fix mm/mmap.c compile errors.
(Portage version: 2.0.51.19)
Diffstat (limited to 'sys-kernel')
4 files changed, 62 insertions, 190 deletions
diff --git a/sys-kernel/xbox-sources/ChangeLog b/sys-kernel/xbox-sources/ChangeLog index ad799d197a2e..593e7c7a3a54 100644 --- a/sys-kernel/xbox-sources/ChangeLog +++ b/sys-kernel/xbox-sources/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for sys-kernel/xbox-sources # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/xbox-sources/ChangeLog,v 1.29 2005/03/26 20:28:36 plasmaroo Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/xbox-sources/ChangeLog,v 1.30 2005/04/13 19:32:40 plasmaroo Exp $ + + 13 Apr 2005; <plasmaroo@gentoo.org> xbox-sources-2.6.10-r2.ebuild, + -files/xbox-sources-2.6.10.77094.patch, + files/xbox-sources-2.6.10.77666.patch: + Fix mm/mmap.c compile errors. *xbox-sources-2.6.10-r2 (26 Mar 2005) diff --git a/sys-kernel/xbox-sources/files/xbox-sources-2.6.10.77094.patch b/sys-kernel/xbox-sources/files/xbox-sources-2.6.10.77094.patch deleted file mode 100644 index bc4ba1a9a207..000000000000 --- a/sys-kernel/xbox-sources/files/xbox-sources-2.6.10.77094.patch +++ /dev/null @@ -1,163 +0,0 @@ -diff -urNp linux-2.6.10/drivers/char/moxa.c linux-2.6.10-new/drivers/char/moxa.c ---- linux-2.6.10/drivers/char/moxa.c 2005-01-07 10:51:23 -0500 -+++ linux-2.6.10-new/drivers/char/moxa.c 2005-01-07 10:51:33 -0500 -@@ -1668,6 +1668,8 @@ int MoxaDriverIoctl(unsigned int cmd, un - return -EFAULT; - if(dltmp.cardno < 0 || dltmp.cardno >= MAX_BOARDS) - return -EINVAL; -+ if(dltmp.len < 0 || dltmp.len > sizeof(moxaBuff)) -+ return -EINVAL; - - switch(cmd) - { -@@ -2822,8 +2824,6 @@ static int moxaload320b(int cardno, unsi - void __iomem *baseAddr; - int i; - -- if(len > sizeof(moxaBuff)) -- return -EINVAL; - if(copy_from_user(moxaBuff, tmp, len)) - return -EFAULT; - baseAddr = moxaBaseAddr[cardno]; -diff -urNp linux-2.6.10/drivers/block/scsi_ioctl.c linux-2.6.10-new/drivers/block/scsi_ioctl.c ---- linux-2.6.10/drivers/block/scsi_ioctl.c 2005-01-07 10:51:24 -0500 -+++ linux-2.6.10-new/drivers/block/scsi_ioctl.c 2005-01-07 10:51:33 -0500 -@@ -339,7 +339,8 @@ static int sg_scsi_ioctl(struct file *fi - struct gendisk *bd_disk, Scsi_Ioctl_Command __user *sic) - { - struct request *rq; -- int err, in_len, out_len, bytes, opcode, cmdlen; -+ unsigned int in_len, out_len, bytes, opcode, cmdlen; -+ int err; - char *buffer = NULL, sense[SCSI_SENSE_BUFFERSIZE]; - - /* -diff -urNp linux-2.6.10/include/linux/writeback.h linux-2.6.10-new/include/linux/writeback.h ---- linux-2.6.10/include/linux/writeback.h 2005-01-07 10:51:22 -0500 -+++ linux-2.6.10-new/include/linux/writeback.h 2005-01-07 10:51:33 -0500 -@@ -86,6 +86,7 @@ static inline void wait_on_inode(struct - int wakeup_bdflush(long nr_pages); - void laptop_io_completion(void); - void laptop_sync_completion(void); -+void throttle_vm_writeout(void); - - /* These are exported to sysctl. */ - extern int dirty_background_ratio; -diff -urNp linux-2.6.10/drivers/char/random.c linux-2.6.10-new/drivers/char/random.c ---- linux-2.6.10/drivers/char/random.c 2005-01-07 10:51:23 -0500 -+++ linux-2.6.10-new/drivers/char/random.c 2005-01-07 10:51:33 -0500 -@@ -1912,7 +1912,7 @@ static int poolsize_strategy(ctl_table * - void __user *oldval, size_t __user *oldlenp, - void __user *newval, size_t newlen, void **context) - { -- int len; -+ size_t len; - - sysctl_poolsize = random_state->poolinfo.POOLBYTES; - -diff -urNp linux-2.6.10/mm/mmap.c linux-2.6.10-new/mm/mmap.c ---- linux-2.6.10/mm/mmap.c 2004-12-24 22:35:00.000000000 +0100 -+++ linux-2.6.10-new/mm/mmap.c 2004-12-27 16:37:47.000000000 +0100 -@@ -1360,6 +1360,13 @@ int expand_stack(struct vm_area_struct * - vm_unacct_memory(grow); - return -ENOMEM; - } -+ if ((vma->vm_flags & VM_LOCKED) && !capable(CAP_IPC_LOCK) && -+ ((vma->vm_mm->locked_vm + grow) << PAGE_SHIFT) > -+ current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur) { -+ anon_vma_unlock(vma); -+ vm_unacct_memory(grow); -+ return -ENOMEM; -+ } - vma->vm_end = address; - vma->vm_mm->total_vm += grow; - if (vma->vm_flags & VM_LOCKED) -@@ -1422,6 +1429,13 @@ int expand_stack(struct vm_area_struct * - vm_unacct_memory(grow); - return -ENOMEM; - } -+ if ((vma->vm_flags & VM_LOCKED) && !capable(CAP_IPC_LOCK) && -+ ((vma->vm_mm->locked_vm + grow) << PAGE_SHIFT) > -+ current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur) { -+ anon_vma_unlock(vma); -+ vm_unacct_memory(grow); -+ return -ENOMEM; -+ } - vma->vm_start = address; - vma->vm_pgoff -= grow; - vma->vm_mm->total_vm += grow; -diff -urNp linux-2.6.10/mm/page-writeback.c linux-2.6.10-new/mm/page-writeback.c ---- linux-2.6.10/mm/page-writeback.c 2005-01-07 10:51:24 -0500 -+++ linux-2.6.10-new/mm/page-writeback.c 2005-01-07 10:51:33 -0500 -@@ -276,6 +276,28 @@ void balance_dirty_pages_ratelimited(str - } - EXPORT_SYMBOL(balance_dirty_pages_ratelimited); - -+void throttle_vm_writeout(void) -+{ -+ struct writeback_state wbs; -+ long background_thresh; -+ long dirty_thresh; -+ -+ for ( ; ; ) { -+ get_dirty_limits(&wbs, &background_thresh, &dirty_thresh); -+ -+ /* -+ * Boost the allowable dirty threshold a bit for page -+ * allocators so they don't get DoS'ed by heavy writers -+ */ -+ dirty_thresh += dirty_thresh / 10; /* wheeee... */ -+ -+ if (wbs.nr_unstable + wbs.nr_writeback <= dirty_thresh) -+ break; -+ blk_congestion_wait(WRITE, HZ/10); -+ } -+} -+ -+ - /* - * writeback at least _min_pages, and keep writing until the amount of dirty - * memory is less than the background threshold, or until we're all clean. -diff -urNp linux-2.6.10/mm/vmscan.c linux-2.6.10-new/mm/vmscan.c ---- linux-2.6.10/mm/vmscan.c 2005-01-07 10:51:24 -0500 -+++ linux-2.6.10-new/mm/vmscan.c 2005-01-07 10:51:33 -0500 -@@ -369,14 +369,14 @@ static int shrink_list(struct list_head - - BUG_ON(PageActive(page)); - -- if (PageWriteback(page)) -- goto keep_locked; -- - sc->nr_scanned++; - /* Double the slab pressure for mapped and swapcache pages */ - if (page_mapped(page) || PageSwapCache(page)) - sc->nr_scanned++; - -+ if (PageWriteback(page)) -+ goto keep_locked; -+ - referenced = page_referenced(page, 1, sc->priority <= 0); - /* In active use or really unfreeable? Activate it. */ - if (referenced && page_mapping_inuse(page)) -@@ -825,6 +825,8 @@ shrink_zone(struct zone *zone, struct sc - break; - } - } -+ -+ throttle_vm_writeout(); - } - - /* -diff -urNp linux-2.6.10/net/ipv4/netfilter/ip_conntrack_proto_tcp.c linux-2.6.10-new/net/ipv4/netfilter/ip_conntrack_proto_tcp.c ---- linux-2.6.10/net/ipv4/netfilter/ip_conntrack_proto_tcp.c 2005-01-07 10:51:24 -0500 -+++ linux-2.6.10-new/net/ipv4/netfilter/ip_conntrack_proto_tcp.c 2005-01-07 10:51:33 -0500 -@@ -906,7 +906,8 @@ static int tcp_packet(struct ip_conntrac - if (index == TCP_RST_SET - && ((test_bit(IPS_SEEN_REPLY_BIT, &conntrack->status) - && conntrack->proto.tcp.last_index <= TCP_SYNACK_SET) -- || conntrack->proto.tcp.last_index == TCP_ACK_SET) -+ || (!test_bit(IPS_ASSURED_BIT, &conntrack->status) -+ && conntrack->proto.tcp.last_index == TCP_ACK_SET)) - && after(ntohl(th->ack_seq), - conntrack->proto.tcp.last_seq)) { - /* Ignore RST closing down invalid SYN or ACK diff --git a/sys-kernel/xbox-sources/files/xbox-sources-2.6.10.77666.patch b/sys-kernel/xbox-sources/files/xbox-sources-2.6.10.77666.patch index 2fc42f237429..035a396a8057 100644 --- a/sys-kernel/xbox-sources/files/xbox-sources-2.6.10.77666.patch +++ b/sys-kernel/xbox-sources/files/xbox-sources-2.6.10.77666.patch @@ -1,6 +1,47 @@ ---- linux-2.6.9/mm/mmap.c 2005-03-16 21:06:42.000000000 +0000 -+++ linux-2.6.9-plasmaroo/mm/mmap.c 2005-03-16 21:09:26.000000000 +0000 -@@ -1316,13 +1316,57 @@ out: +# ChangeSet #3 +# 2005/01/12 08:09:20-08:00 torvalds@ppc970.osdl.org +# Handle two threads both trying to expand their stack simultaneously. +# +# We had all the locking right, but we didn't check whether one of the +# threads now no longer needed to expand, so we could incorrectly _shrink_ +# the stack in the other thread instead (not only causing segfaults, but +# since we didn't do a proper unmap, we'd possibly leak pages too). +# +# So re-check the need for expand after getting the lock. +# +# Noticed by Paul Starzetz. +# +# ChangeSet #2 +# 2005/01/10 11:23:42-08:00 torvalds@ppc970.osdl.org +# Clean up stack growth checks and move them into a common function. +# +# The grows-up and grows-down cases had all the same issues, but +# differered in the details. Additionlly, historical evolution of +# the tests had caused the result to be pretty unreadable with some +# rather long and complex conditionals. +# +# Fix it all up in a more readable helper function. +# +# This also adds the missing RLIMIT_MEMLOCK test. +# +# ChangeSet #1 +# 2005/01/11 07:40:07-08:00 chrisw@osdl.org +# [PATCH] acct_stack_growth nitpicks +# +# - allow CAP_IPC_LOCK to override mlock rlimit during stack expansion as +# in all other cases +# +# Signed-off-by: Chris Wright <chrisw@osdl.org> +# Signed-off-by: Linus Torvalds <torvalds@osdl.org> +# +# mm/mmap.c +# 2005/01/10 19:34:05-08:00 chrisw@osdl.org +1 -1 +# acct_stack_growth nitpicks +# +diff -urNp linux-2.6.10/mm/mmap.c linux-2.6.10.plasmaroo/mm/mmap.c +--- linux-2.6.10/mm/mmap.c 2004-12-24 21:35:00.000000000 +0000 ++++ linux-2.6.10.plasmaroo/mm/mmap.c 2005-01-15 21:49:26.000000000 +0000 +@@ -1319,13 +1319,57 @@ out: return prev ? prev->vm_next : vma; } @@ -12,10 +53,10 @@ +static int acct_stack_growth(struct vm_area_struct * vma, unsigned long size, unsigned long grow) +{ + struct mm_struct *mm = vma->vm_mm; -+ struct rlimit *rlim = current->rlim; ++ struct rlimit *rlim = current->signal->rlim; + + /* address space limit tests */ -+ rlim = current->rlim; ++ rlim = current->signal->rlim; + if (mm->total_vm + grow > rlim[RLIMIT_AS].rlim_cur >> PAGE_SHIFT) + return -ENOMEM; + @@ -59,7 +100,7 @@ if (!(vma->vm_flags & VM_GROWSUP)) return -EFAULT; -@@ -1342,20 +1386,18 @@ int expand_stack(struct vm_area_struct * +@@ -1345,28 +1389,25 @@ int expand_stack(struct vm_area_struct * */ address += 4 + PAGE_SIZE - 1; address &= PAGE_MASK; @@ -89,27 +130,23 @@ + if (!error) + vma->vm_end = address; } - if ((vma->vm_flags & VM_LOCKED) && !capable(CAP_IPC_LOCK) && - ((vma->vm_mm->locked_vm + grow) << PAGE_SHIFT) > -@@ -1364,13 +1406,12 @@ int expand_stack(struct vm_area_struct * - vm_unacct_memory(grow); - return -ENOMEM; - } - vma->vm_end = address; - vma->vm_mm->total_vm += grow; - if (vma->vm_flags & VM_LOCKED) - vma->vm_mm->locked_vm += grow; +- __vm_stat_account(vma->vm_mm, vma->vm_flags, vma->vm_file, grow); +- anon_vma_unlock(vma); +- return 0; ++ + error = acct_stack_growth(vma, size, grow); + if (!error) + vma->vm_end = address; - __vm_stat_account(vma->vm_mm, vma->vm_flags, vma->vm_file, grow); - anon_vma_unlock(vma); -- return 0; ++ anon_vma_unlock(vma); + return error; } struct vm_area_struct * -@@ -1395,7 +1436,7 @@ find_extend_vma(struct mm_struct *mm, un +@@ -1391,7 +1432,7 @@ find_extend_vma(struct mm_struct *mm, un */ int expand_stack(struct vm_area_struct *vma, unsigned long address) { @@ -118,7 +155,7 @@ /* * We must make sure the anon_vma is allocated -@@ -1411,20 +1452,20 @@ int expand_stack(struct vm_area_struct * +@@ -1407,29 +1448,23 @@ int expand_stack(struct vm_area_struct * * anon_vma lock to serialize against concurrent expand_stacks. */ address &= PAGE_MASK; @@ -150,18 +187,12 @@ + vma->vm_pgoff -= grow; + } } - if ((vma->vm_flags & VM_LOCKED) && !capable(CAP_IPC_LOCK) && - ((vma->vm_mm->locked_vm + grow) << PAGE_SHIFT) > -@@ -1433,14 +1474,9 @@ int expand_stack(struct vm_area_struct * - vm_unacct_memory(grow); - return -ENOMEM; - } - vma->vm_start = address; - vma->vm_pgoff -= grow; - vma->vm_mm->total_vm += grow; - if (vma->vm_flags & VM_LOCKED) - vma->vm_mm->locked_vm += grow; - __vm_stat_account(vma->vm_mm, vma->vm_flags, vma->vm_file, grow); +- __vm_stat_account(vma->vm_mm, vma->vm_flags, vma->vm_file, grow); anon_vma_unlock(vma); - return 0; + return error; diff --git a/sys-kernel/xbox-sources/xbox-sources-2.6.10-r2.ebuild b/sys-kernel/xbox-sources/xbox-sources-2.6.10-r2.ebuild index 1ccbb01ce351..122a5efbfd35 100644 --- a/sys-kernel/xbox-sources/xbox-sources-2.6.10-r2.ebuild +++ b/sys-kernel/xbox-sources/xbox-sources-2.6.10-r2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/xbox-sources/xbox-sources-2.6.10-r2.ebuild,v 1.1 2005/03/26 20:28:36 plasmaroo Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/xbox-sources/xbox-sources-2.6.10-r2.ebuild,v 1.2 2005/04/13 19:32:40 plasmaroo Exp $ ETYPE='sources' inherit kernel-2 @@ -17,7 +17,6 @@ UNIPATCH_LIST=" ${FILESDIR}/${P}.smbfs.patch ${FILESDIR}/${P}.75963.patch ${FILESDIR}/${P}.brk-locked.patch - ${FILESDIR}/${P}.77094.patch ${FILESDIR}/${P}.74070.patch ${FILESDIR}/${P}.77666.patch ${FILESDIR}/${P}.77923.patch |