[PATCH] Fix process lockup on a loop device

Ryota Ozaki <[email protected]>
Newsgroups gmane.linux.vserver
Message-ID <[email protected]>
lo_open returns with holding loop_index_mutex when
vx_check failed, resulting in a process lockup on
a loop device.

Signed-off-by: Ryota Ozaki <[email protected]>
---
 drivers/block/loop.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index b01b03c..c34ad3b 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1494,8 +1494,10 @@ static int lo_open(struct block_device *bdev, fmode_t mode)
 		goto out;
 	}
 
-	if (!vx_check(lo->lo_xid, VS_IDENT|VS_HOSTID|VS_ADMIN_P))
-		return -EACCES;
+	if (!vx_check(lo->lo_xid, VS_IDENT|VS_HOSTID|VS_ADMIN_P)) {
+		err = -EACCES;
+		goto out;
+	}
 
 	mutex_lock(&lo->lo_ctl_mutex);
 	lo->lo_refcnt++;
-- 
1.7.5.4
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.