From 1e037b4dd50885ea5eb55023e128a1396c38174f Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Thu, 12 Jan 2012 17:51:17 +0100 Subject: [PATCH] fix waiting condition if_switch() must not be called when requests are flying. It is better to get a hung task instead (crashes are worse). --- mars_if.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mars_if.c b/mars_if.c index 3ab7f7b7..fc3426d6 100644 --- a/mars_if.c +++ b/mars_if.c @@ -708,16 +708,13 @@ static int if_open(struct block_device *bdev, fmode_t mode) static int if_release(struct gendisk *gd, fmode_t mode) { struct if_input *input = gd->private_data; - int max = 0; int nr; MARS_INF("----------------------- CLOSE %d ------------------------------\n", atomic_read(&input->open_count)); while ((nr = atomic_read(&input->flying_count)) > 0) { MARS_INF("%d IO requests not yet completed\n", nr); - if (max++ > 10) - break; - msleep(2000); + msleep(3000); } if (atomic_dec_and_test(&input->open_count)) {