* linux-next: manual merge of the limits tree with Linus' tree
@ 2009-12-14 3:39 Stephen Rothwell
2009-12-14 10:10 ` Jiri Slaby
0 siblings, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2009-12-14 3:39 UTC (permalink / raw)
To: Jiri Slaby; +Cc: linux-next, linux-kernel, Al Viro
[-- Attachment #1: Type: text/plain, Size: 576 bytes --]
Hi Jiri,
Today's linux-next merge of the limits tree got a conflict in
arch/ia64/kernel/sys_ia64.c between commit
bb52d6694002b9d632bb355f64daa045c6293a4e ("Get rid of open-coding in
ia64_brk()") from Linus' tree and commit
d9ef7d0ce61f214180f505b78cdf8f9b3d862dfa ("IA64: use helpers for
rlimits") from the limits tree.
The former removed the code that the latter was updating. A merge with
Linus' tree will fix this up, but it is pretty trivial anyway.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* linux-next: manual merge of the limits tree with Linus' tree
@ 2009-12-14 3:39 Stephen Rothwell
2009-12-14 10:04 ` Arnd Bergmann
0 siblings, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2009-12-14 3:39 UTC (permalink / raw)
To: Jiri Slaby; +Cc: linux-next, linux-kernel, Arnd Bergmann, Neil Horman
Hi Jiri,
Today's linux-next merge of the limits tree got a conflict in
include/asm-generic/unistd.h between commits
9ab87644393d789b950ba984fa360f45c4df02e5 ("asm-generic: add sys_accept4
to unistd.h") and 3d7703870633dd454f6554e6d8d7f70441d0fd2d ("asm-generic:
add sys_recvmmsg to unistd.h") from Linus' tree and commit
cf8b57cd6af6ccbb8f6de90e677b1e5aca99c472 ("unistd: add __NR_[get|set]
prlimit syscall numbers") from the limits tree.
I fixed it up (see below) and can carry the fix for a while. Jiri, you
should fix this by doing a merge of Linus' tree before asking him to pull
yours.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --cc include/asm-generic/unistd.h
index 6a0b30f,950587d..0000000
--- a/include/asm-generic/unistd.h
+++ b/include/asm-generic/unistd.h
@@@ -622,13 -622,13 +622,17 @@@ __SYSCALL(__NR_move_pages, sys_move_pag
__SYSCALL(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo)
#define __NR_perf_event_open 241
__SYSCALL(__NR_perf_event_open, sys_perf_event_open)
-#define __NR_getprlimit 242
+#define __NR_accept4 242
+__SYSCALL(__NR_accept4, sys_accept4)
+#define __NR_recvmmsg 243
+__SYSCALL(__NR_recvmmsg, sys_recvmmsg)
++#define __NR_getprlimit 244
+ __SYSCALL(__NR_getprlimit, sys_getprlimit)
-#define __NR_setprlimit 243
++#define __NR_setprlimit 245
+ __SYSCALL(__NR_setprlimit, sys_setprlimit)
#undef __NR_syscalls
--#define __NR_syscalls 244
++#define __NR_syscalls 246
/*
* All syscalls below here should go away really,
^ permalink raw reply [flat|nested] 6+ messages in thread
* linux-next: manual merge of the limits tree with Linus' tree
@ 2009-12-14 3:39 Stephen Rothwell
0 siblings, 0 replies; 6+ messages in thread
From: Stephen Rothwell @ 2009-12-14 3:39 UTC (permalink / raw)
To: Jiri Slaby; +Cc: linux-next, linux-kernel, Al Viro
Hi Jiri,
Today's linux-next merge of the limits tree got a conflict in mm/mremap.c
between commit 54f5de709984bae0d31d823ff03de755f9dcac54 ("untangling
do_mremap(), part 1") from Linus' tree and commit
518b0eb18cb50901611d5365d657e11ff0b4931f ("MM: use helpers for rlimits")
from the limits tree.
The former moved the code changed in the latter. I fixed it up (see
below) and can carry the fix for a while. Again, a merge with Linus'
tree will fix this up.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --cc mm/mremap.c
index 8451908,d6740a1..0000000
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@@ -261,137 -261,6 +261,137 @@@ static unsigned long move_vma(struct vm
return new_addr;
}
+static struct vm_area_struct *vma_to_resize(unsigned long addr,
+ unsigned long old_len, unsigned long new_len, unsigned long *p)
+{
+ struct mm_struct *mm = current->mm;
+ struct vm_area_struct *vma = find_vma(mm, addr);
+
+ if (!vma || vma->vm_start > addr)
+ goto Efault;
+
+ if (is_vm_hugetlb_page(vma))
+ goto Einval;
+
+ /* We can't remap across vm area boundaries */
+ if (old_len > vma->vm_end - addr)
+ goto Efault;
+
+ if (vma->vm_flags & (VM_DONTEXPAND | VM_PFNMAP)) {
+ if (new_len > old_len)
+ goto Efault;
+ }
+
+ if (vma->vm_flags & VM_LOCKED) {
+ unsigned long locked, lock_limit;
+ locked = mm->locked_vm << PAGE_SHIFT;
- lock_limit = current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur;
++ lock_limit = rlimit(RLIMIT_MEMLOCK);
+ locked += new_len - old_len;
+ if (locked > lock_limit && !capable(CAP_IPC_LOCK))
+ goto Eagain;
+ }
+
+ if (!may_expand_vm(mm, (new_len - old_len) >> PAGE_SHIFT))
+ goto Enomem;
+
+ if (vma->vm_flags & VM_ACCOUNT) {
+ unsigned long charged = (new_len - old_len) >> PAGE_SHIFT;
+ if (security_vm_enough_memory(charged))
+ goto Efault;
+ *p = charged;
+ }
+
+ return vma;
+
+Efault: /* very odd choice for most of the cases, but... */
+ return ERR_PTR(-EFAULT);
+Einval:
+ return ERR_PTR(-EINVAL);
+Enomem:
+ return ERR_PTR(-ENOMEM);
+Eagain:
+ return ERR_PTR(-EAGAIN);
+}
+
+static unsigned long mremap_to(unsigned long addr,
+ unsigned long old_len, unsigned long new_addr,
+ unsigned long new_len)
+{
+ struct mm_struct *mm = current->mm;
+ struct vm_area_struct *vma;
+ unsigned long ret = -EINVAL;
+ unsigned long charged = 0;
+ unsigned long map_flags;
+
+ if (new_addr & ~PAGE_MASK)
+ goto out;
+
+ if (new_len > TASK_SIZE || new_addr > TASK_SIZE - new_len)
+ goto out;
+
+ /* Check if the location we're moving into overlaps the
+ * old location at all, and fail if it does.
+ */
+ if ((new_addr <= addr) && (new_addr+new_len) > addr)
+ goto out;
+
+ if ((addr <= new_addr) && (addr+old_len) > new_addr)
+ goto out;
+
+ ret = security_file_mmap(NULL, 0, 0, 0, new_addr, 1);
+ if (ret)
+ goto out;
+
+ ret = do_munmap(mm, new_addr, new_len);
+ if (ret)
+ goto out;
+
+ if (old_len >= new_len) {
+ ret = do_munmap(mm, addr+new_len, old_len - new_len);
+ if (ret && old_len != new_len)
+ goto out;
+ old_len = new_len;
+ }
+
+ vma = vma_to_resize(addr, old_len, new_len, &charged);
+ if (IS_ERR(vma)) {
+ ret = PTR_ERR(vma);
+ goto out;
+ }
+
+ map_flags = MAP_FIXED;
+ if (vma->vm_flags & VM_MAYSHARE)
+ map_flags |= MAP_SHARED;
+
+ ret = get_unmapped_area(vma->vm_file, new_addr, new_len, vma->vm_pgoff +
+ ((addr - vma->vm_start) >> PAGE_SHIFT),
+ map_flags);
+ if (ret & ~PAGE_MASK)
+ goto out1;
+
+ ret = move_vma(vma, addr, old_len, new_len, new_addr);
+ if (!(ret & ~PAGE_MASK))
+ goto out;
+out1:
+ vm_unacct_memory(charged);
+
+out:
+ return ret;
+}
+
+static int vma_expandable(struct vm_area_struct *vma, unsigned long delta)
+{
+ unsigned long end = vma->vm_end + delta;
+ if (end < vma->vm_end) /* overflow */
+ return 0;
+ if (vma->vm_next && vma->vm_next->vm_start < end) /* intersection */
+ return 0;
+ if (get_unmapped_area(NULL, vma->vm_start, end - vma->vm_start,
+ 0, MAP_FIXED) & ~PAGE_MASK)
+ return 0;
+ return 1;
+}
+
/*
* Expand (or shrink) an existing mapping, potentially moving it at the
* same time (controlled by the MREMAP_MAYMOVE flag and available VM space)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: linux-next: manual merge of the limits tree with Linus' tree
2009-12-14 3:39 linux-next: manual merge of the limits tree with Linus' tree Stephen Rothwell
@ 2009-12-14 10:04 ` Arnd Bergmann
0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2009-12-14 10:04 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: Jiri Slaby, linux-next, linux-kernel, Neil Horman
On Monday 14 December 2009, Stephen Rothwell wrote:
> @@@ -622,13 -622,13 +622,17 @@@ __SYSCALL(__NR_move_pages, sys_move_pag
> __SYSCALL(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo)
> #define __NR_perf_event_open 241
> __SYSCALL(__NR_perf_event_open, sys_perf_event_open)
> -#define __NR_getprlimit 242
> +#define __NR_accept4 242
> +__SYSCALL(__NR_accept4, sys_accept4)
> +#define __NR_recvmmsg 243
> +__SYSCALL(__NR_recvmmsg, sys_recvmmsg)
> ++#define __NR_getprlimit 244
> + __SYSCALL(__NR_getprlimit, sys_getprlimit)
> -#define __NR_setprlimit 243
> ++#define __NR_setprlimit 245
> + __SYSCALL(__NR_setprlimit, sys_setprlimit)
>
> #undef __NR_syscalls
> --#define __NR_syscalls 244
> ++#define __NR_syscalls 246
Looks good.
Arnd
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: linux-next: manual merge of the limits tree with Linus' tree
2009-12-14 3:39 Stephen Rothwell
@ 2009-12-14 10:10 ` Jiri Slaby
2009-12-14 10:29 ` Stephen Rothwell
0 siblings, 1 reply; 6+ messages in thread
From: Jiri Slaby @ 2009-12-14 10:10 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Al Viro
On 12/14/2009 04:39 AM, Stephen Rothwell wrote:
> Today's linux-next merge of the limits tree got a conflict in
> arch/ia64/kernel/sys_ia64.c between commit
> bb52d6694002b9d632bb355f64daa045c6293a4e ("Get rid of open-coding in
> ia64_brk()") from Linus' tree and commit
> d9ef7d0ce61f214180f505b78cdf8f9b3d862dfa ("IA64: use helpers for
> rlimits") from the limits tree.
>
> The former removed the code that the latter was updating. A merge with
> Linus' tree will fix this up, but it is pretty trivial anyway.
Hi.
Thanks, I fixed all 3 conflicts.
--
js
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: linux-next: manual merge of the limits tree with Linus' tree
2009-12-14 10:10 ` Jiri Slaby
@ 2009-12-14 10:29 ` Stephen Rothwell
0 siblings, 0 replies; 6+ messages in thread
From: Stephen Rothwell @ 2009-12-14 10:29 UTC (permalink / raw)
To: Jiri Slaby; +Cc: linux-next, linux-kernel, Al Viro
[-- Attachment #1: Type: text/plain, Size: 254 bytes --]
Hi Jiri,
On Mon, 14 Dec 2009 11:10:45 +0100 Jiri Slaby <jirislaby@gmail.com> wrote:
>
> Thanks, I fixed all 3 conflicts.
Great, thanks.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-12-14 10:29 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-14 3:39 linux-next: manual merge of the limits tree with Linus' tree Stephen Rothwell
2009-12-14 10:04 ` Arnd Bergmann
-- strict thread matches above, loose matches on Subject: below --
2009-12-14 3:39 Stephen Rothwell
2009-12-14 3:39 Stephen Rothwell
2009-12-14 10:10 ` Jiri Slaby
2009-12-14 10:29 ` Stephen Rothwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).