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 cleanup after unclean app

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] blktap: fix cleanup after unclean application exit #2
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 22 Apr 2010 01:50:06 -0700
Delivery-date: Thu, 22 Apr 2010 01:50:21 -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 1271925346 -3600
# Node ID 2a4b455b1fbab6405d06f446484d9fe9b20be619
# Parent  347237fd42d855bb301159c85e9f962d8521a21f
blktap: fix cleanup after unclean application exit #2

When an application using blktap devices doesn't close the mmap-s of
/dev/xen/blktapN and the frontend driver never connects, we cannot
defer the mmput() on the stored mm until blktap_release() or the exit
path of the worker thread, as the former will never be called without
the mm's reference count dropping to zero, and the worker thread
would never get started.

Also remove a left-over from c/s 1013.

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

diff -r 347237fd42d8 -r 2a4b455b1fba drivers/xen/blktap/blktap.c
--- a/drivers/xen/blktap/blktap.c       Mon Apr 19 17:19:56 2010 +0100
+++ b/drivers/xen/blktap/blktap.c       Thu Apr 22 09:35:46 2010 +0100
@@ -553,6 +553,7 @@ void signal_tapdisk(int idx)
 {
        tap_blkif_t *info;
        struct task_struct *ptask;
+       struct mm_struct *mm;
 
        /*
         * if the userland tools set things up wrong, this could be negative;
@@ -572,7 +573,9 @@ void signal_tapdisk(int idx)
        }
        info->blkif = NULL;
 
-       return;
+       mm = xchg(&info->mm, NULL);
+       if (mm)
+               mmput(mm);
 }
 
 static int blktap_open(struct inode *inode, struct file *filp)
@@ -652,7 +655,6 @@ static int blktap_release(struct inode *
        mm = xchg(&info->mm, NULL);
        if (mm)
                mmput(mm);
-       info->mm = NULL;
        kfree(info->foreign_map.map);
        info->foreign_map.map = NULL;
 

_______________________________________________
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 cleanup after unclean application exit #2, Xen patchbot-linux-2.6.18-xen <=