From: Pekka Enberg <[EMAIL PROTECTED]>

As pointed out by Nick Piggin, __revoke_break_cow() only needs to do
down_read() and we must use vma_pages() for get_user_pages().

Cc: Nick Piggin <[EMAIL PROTECTED]>
Signed-off-by: Pekka Enberg <[EMAIL PROTECTED]>
---
 fs/revoke.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Index: uml-2.6/fs/revoke.c
===================================================================
--- uml-2.6.orig/fs/revoke.c    2007-03-28 12:25:29.000000000 +0300
+++ uml-2.6/fs/revoke.c 2007-03-28 12:54:49.000000000 +0300
@@ -184,7 +184,7 @@ static int __revoke_break_cow(struct tas
        struct vm_area_struct *vma;
        int err = 0;
 
-       down_write(&mm->mmap_sem);
+       down_read(&mm->mmap_sem);
        for (vma = mm->mmap; vma != NULL; vma = vma->vm_next) {
                int ret;
 
@@ -195,14 +195,13 @@   int err = 0;
                        continue;
 
                ret = get_user_pages(tsk, tsk->mm, vma->vm_start,
-                                    vma->vm_end-vma->vm_start, 1, 1, NULL,
-                                    NULL);
+                                    vma_pages(vma), 1, 1, NULL, NULL);
                if (ret < 0) {
                        err = ret;
                        break;
                }
        }
-       up_write(&mm->mmap_sem);
+       up_read(&mm->mmap_sem);
        return err;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to