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] blktap: fix race memory refernce with

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] blktap: fix race memory refernce with ring_ok.
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 28 Apr 2009 09:15:14 -0700
Delivery-date: Tue, 28 Apr 2009 09:15:41 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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.fraser@xxxxxxxxxx>
# Date 1240922586 -3600
# Node ID 3232c6e19bdc219363446f837c4136dc9959c205
# Parent  613216635ff0d0adf114bd5106bb37ae74fff458
blktap: fix race memory refernce with ring_ok.

fix race memory refernce with ring_ok.
ring_ok is shared by mmapping process and blktap kernel thread.

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
 drivers/xen/blktap/blktap.c |    5 +++++
 1 files changed, 5 insertions(+)

diff -r 613216635ff0 -r 3232c6e19bdc drivers/xen/blktap/blktap.c
--- a/drivers/xen/blktap/blktap.c       Tue Apr 28 13:42:32 2009 +0100
+++ b/drivers/xen/blktap/blktap.c       Tue Apr 28 13:43:06 2009 +0100
@@ -617,6 +617,9 @@ static int blktap_release(struct inode *
        if (!info)
                return 0;
 
+       info->ring_ok = 0;
+       smp_wmb();
+
        info->dev_inuse = 0;
        DPRINTK("Freeing device [/dev/xen/blktap%d]\n",info->minor);
 
@@ -717,6 +720,7 @@ static int blktap_mmap(struct file *filp
 #endif
 
        info->vma = vma;
+       smp_wmb();
        info->ring_ok = 1;
        return 0;
  fail:
@@ -1390,6 +1394,7 @@ static void dispatch_rw_block_io(blkif_t
                WPRINTK("blktap: ring not ready for requests!\n");
                goto fail_response;
        }
+       smp_rmb();
 
        if (RING_FULL(&info->ufe_ring)) {
                WPRINTK("blktap: fe_ring is full, can't add "

_______________________________________________
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] blktap: fix race memory refernce with ring_ok., Xen patchbot-linux-2.6.18-xen <=