WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [linux-2.6.18-xen] Revert unnecessary locking changes in

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] Revert unnecessary locking changes in privcmd_ioctl().
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 09 Jul 2007 04:26:55 -0700
Delivery-date: Mon, 09 Jul 2007 04:25:07 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1183799942 -3600
# Node ID 3ac668c7e1aec4e5a7a572e689adb2dab5b90f8d
# Parent  a2acc03e8a4d776b84405f62568442c1bd764dd3
Revert unnecessary locking changes in privcmd_ioctl().
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 drivers/xen/privcmd/privcmd.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff -r a2acc03e8a4d -r 3ac668c7e1ae drivers/xen/privcmd/privcmd.c
--- a/drivers/xen/privcmd/privcmd.c     Fri Jul 06 15:52:42 2007 -0500
+++ b/drivers/xen/privcmd/privcmd.c     Sat Jul 07 10:19:02 2007 +0100
@@ -112,7 +112,7 @@ static int privcmd_ioctl(struct inode *i
                if (copy_from_user(&msg, p, sizeof(msg)))
                        return -EFAULT;
 
-               down_write(&mm->mmap_sem);
+               down_read(&mm->mmap_sem);
 
                vma = find_vma(mm, msg.va);
                rc = -EINVAL;
@@ -154,7 +154,7 @@ static int privcmd_ioctl(struct inode *i
                rc = 0;
 
        mmap_out:
-               up_write(&mm->mmap_sem);
+               up_read(&mm->mmap_sem);
                ret = rc;
        }
        break;
@@ -177,14 +177,14 @@ static int privcmd_ioctl(struct inode *i
                if ((m.num <= 0) || (nr_pages > (LONG_MAX >> PAGE_SHIFT)))
                        return -EINVAL;
 
-               down_write(&mm->mmap_sem);
+               down_read(&mm->mmap_sem);
 
                vma = find_vma(mm, m.addr);
                if (!vma ||
                    (m.addr != vma->vm_start) ||
                    ((m.addr + (nr_pages << PAGE_SHIFT)) != vma->vm_end) ||
                    !privcmd_enforce_singleshot_mapping(vma)) {
-                       up_write(&mm->mmap_sem);
+                       up_read(&mm->mmap_sem);
                        return -EINVAL;
                }
 
@@ -192,7 +192,7 @@ static int privcmd_ioctl(struct inode *i
                addr = m.addr;
                for (i = 0; i < nr_pages; i++, addr += PAGE_SIZE, p++) {
                        if (get_user(mfn, p)) {
-                               up_write(&mm->mmap_sem);
+                               up_read(&mm->mmap_sem);
                                return -EFAULT;
                        }
 
@@ -203,7 +203,7 @@ static int privcmd_ioctl(struct inode *i
                                put_user(0xF0000000 | mfn, p);
                }
 
-               up_write(&mm->mmap_sem);
+               up_read(&mm->mmap_sem);
                ret = 0;
        }
        break;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] Revert unnecessary locking changes in privcmd_ioctl()., Xen patchbot-linux-2.6.18-xen <=