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/
Home Products Support Community News


[Xen-changelog] [linux-2.6.18-xen] blktap2: fix synchronization in blkta

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] blktap2: fix synchronization in blktap_device_run_queue()
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 19 Nov 2010 05:35:04 -0800
Delivery-date: Fri, 19 Nov 2010 05:35:34 -0800
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@xxxxxxx>
# Date 1290172806 0
# Node ID 75a121aacca6cb8a66ffa8791388d1eb7809e9bf
# Parent  e73077b6d6bfe8f9073c2059671be7c9c391a194
blktap2: fix synchronization in blktap_device_run_queue()

c/s 896 (use of blk_rq_map_sg()) made the problem worse, but from what
I can tell there had been races (ring and stats updates) before. If
that's not a correct observation, a perhaps better solution might be
to move the struct scatterlist array out of struct blktap (and make it
e.g. an on-stack variable, the problem being that
blktap_device_process_request() has a pretty large stack frame
already - shrinking this might be possible by moving e.g. the
struct blktap_grant_table and struct blkif_request blkif_req instances
the other way if the locking change here is the right thing to do).

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
 drivers/xen/blktap2/device.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff -r e73077b6d6bf -r 75a121aacca6 drivers/xen/blktap2/device.c
--- a/drivers/xen/blktap2/device.c      Wed Nov 17 17:16:52 2010 +0000
+++ b/drivers/xen/blktap2/device.c      Fri Nov 19 13:20:06 2010 +0000
@@ -888,7 +888,7 @@ blktap_device_run_queue(struct blktap *t
-               down_read(&tap->tap_sem);
+               down_write(&tap->tap_sem);
                err = blktap_device_process_request(tap, request, req);
                if (!err)
@@ -898,7 +898,7 @@ blktap_device_run_queue(struct blktap *t
                        blktap_request_free(tap, request);
-               up_read(&tap->tap_sem);
+               up_write(&tap->tap_sem);

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] blktap2: fix synchronization in blktap_device_run_queue(), Xen patchbot-linux-2.6.18-xen <=