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).
This commit is contained in:
Thomas Schoebel-Theuer 2012-01-12 17:51:17 +01:00 committed by Thomas Schoebel-Theuer
parent 50bdf270b3
commit 1e037b4dd5
1 changed files with 1 additions and 4 deletions

View File

@ -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)) {