All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dm missing bdput/thaw_bdev at removal
@ 2006-02-24  0:05 ` Jun'ichi Nomura
  0 siblings, 0 replies; 6+ messages in thread
From: Jun'ichi Nomura @ 2006-02-24  0:05 UTC (permalink / raw)
  To: device-mapper development; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 586 bytes --]

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.

[-- Attachment #2: dm-missing-bdput.patch --]
[-- Type: text/x-patch, Size: 638 bytes --]

Need to unfreeze and release bdev
otherwise the bdev inode with inconsistent state is reused later
and cause problem.

Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>

--- linux-2.6.15.orig/drivers/md/dm.c	2006-02-23 18:28:23.000000000 -0500
+++ linux-2.6.15/drivers/md/dm.c	2006-02-23 18:29:04.000000000 -0500
@@ -812,6 +812,10 @@ static struct mapped_device *alloc_dev(u
 
 static void free_dev(struct mapped_device *md)
 {
+	if (md->suspended_bdev) {
+		thaw_bdev(md->suspended_bdev, NULL);
+		bdput(md->suspended_bdev);
+	}
 	free_minor(md->disk->first_minor);
 	mempool_destroy(md->tio_pool);
 	mempool_destroy(md->io_pool);

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] dm missing bdput/thaw_bdev at removal
@ 2006-02-24  0:05 ` Jun'ichi Nomura
  0 siblings, 0 replies; 6+ messages in thread
From: Jun'ichi Nomura @ 2006-02-24  0:05 UTC (permalink / raw)
  To: device-mapper development; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 586 bytes --]

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.

[-- Attachment #2: dm-missing-bdput.patch --]
[-- Type: text/x-patch, Size: 638 bytes --]

Need to unfreeze and release bdev
otherwise the bdev inode with inconsistent state is reused later
and cause problem.

Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>

--- linux-2.6.15.orig/drivers/md/dm.c	2006-02-23 18:28:23.000000000 -0500
+++ linux-2.6.15/drivers/md/dm.c	2006-02-23 18:29:04.000000000 -0500
@@ -812,6 +812,10 @@ static struct mapped_device *alloc_dev(u
 
 static void free_dev(struct mapped_device *md)
 {
+	if (md->suspended_bdev) {
+		thaw_bdev(md->suspended_bdev, NULL);
+		bdput(md->suspended_bdev);
+	}
 	free_minor(md->disk->first_minor);
 	mempool_destroy(md->tio_pool);
 	mempool_destroy(md->io_pool);

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dm missing bdput/thaw_bdev at removal
  2006-02-24  0:05 ` Jun'ichi Nomura
@ 2006-02-24 16:31   ` Alasdair G Kergon
  -1 siblings, 0 replies; 6+ messages in thread
From: Alasdair G Kergon @ 2006-02-24 16:31 UTC (permalink / raw)
  To: device-mapper development; +Cc: linux-kernel

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
-- 
agk@redhat.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dm-devel] [PATCH] dm missing bdput/thaw_bdev at removal
@ 2006-02-24 16:31   ` Alasdair G Kergon
  0 siblings, 0 replies; 6+ messages in thread
From: Alasdair G Kergon @ 2006-02-24 16:31 UTC (permalink / raw)
  To: device-mapper development; +Cc: linux-kernel

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
-- 
agk@redhat.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dm missing bdput/thaw_bdev at removal
  2006-02-24 16:31   ` [dm-devel] " Alasdair G Kergon
  (?)
@ 2006-02-24 21:21   ` Jonathan E Brassow
  2006-02-25  1:17     ` Alasdair G Kergon
  -1 siblings, 1 reply; 6+ messages in thread
From: Jonathan E Brassow @ 2006-02-24 21:21 UTC (permalink / raw)
  To: device-mapper development

Would this explain the trouble I was having with mirroring and lock_fs?

  brassow

On Feb 24, 2006, at 10:31 AM, Alasdair G Kergon wrote:

> 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
> -- 
> agk@redhat.com
>
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dm missing bdput/thaw_bdev at removal
  2006-02-24 21:21   ` Jonathan E Brassow
@ 2006-02-25  1:17     ` Alasdair G Kergon
  0 siblings, 0 replies; 6+ messages in thread
From: Alasdair G Kergon @ 2006-02-25  1:17 UTC (permalink / raw)
  To: device-mapper development

On Fri, Feb 24, 2006 at 03:21:21PM -0600, Jon Brassow wrote:
> Would this explain the trouble I was having with mirroring and lock_fs?
 
Quite possibly - this one caused problems based on *previous*
actions which you wouldn't normally have thought to associate
with the problem being investigated.

Alasdair
-- 
agk@redhat.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-02-25  1:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-24  0:05 [PATCH] dm missing bdput/thaw_bdev at removal Jun'ichi Nomura
2006-02-24  0:05 ` Jun'ichi Nomura
2006-02-24 16:31 ` Alasdair G Kergon
2006-02-24 16:31   ` [dm-devel] " Alasdair G Kergon
2006-02-24 21:21   ` Jonathan E Brassow
2006-02-25  1:17     ` Alasdair G Kergon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.