2006-02-24 00:03:57

by Junichi Nomura

[permalink] [raw]
Subject: [PATCH] dm missing bdput/thaw_bdev at removal

Hello,

The following script stalls at the 2nd suspend.
It's because bdput() isn't called for the suspended_bdev.

So the inode with bd_mount_sem held is just reused
in the next mapped_device device.
Then dm_suspend will try to freeze_bdev and wait forever.

Attached patch fixes this problem.

------------------------------------------------------------
#!/bin/sh -x

map=a
while true; do
dmsetup create $map --notable
dmsetup suspend $map
dmsetup remove $map
done
------------------------------------------------------------

--
Jun'ichi Nomura, NEC Solutions (America), Inc.


Attachments:
dm-missing-bdput.patch (638.00 B)

2006-02-24 16:31:15

by Alasdair G Kergon

[permalink] [raw]
Subject: Re: [dm-devel] [PATCH] dm missing bdput/thaw_bdev at removal

On Thu, Feb 23, 2006 at 07:05:09PM -0500, Jun'ichi Nomura wrote:
> Then dm_suspend will try to freeze_bdev and wait forever.

> Attached patch fixes this problem.

Indeed - well spotted!

Alasdair
--
[email protected]