All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dm: use revalidate_disk to update device size after set_capacity
@ 2010-10-19 22:07 Mike Snitzer
  2010-10-20  5:42 ` Jun'ichi Nomura
  2010-10-29 21:50 ` dm: lock bd_mutex when setting device size Mike Snitzer
  0 siblings, 2 replies; 11+ messages in thread
From: Mike Snitzer @ 2010-10-19 22:07 UTC (permalink / raw)
  To: dm-devel

Avoid taking md->bdev->bd_inode->i_mutex to update the DM block device's
size.  Doing so eliminates the potential for deadlock if an fsync is
racing with a device resize.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
---
 drivers/md/dm.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index f934e98..fd315a7 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1995,10 +1995,7 @@ static void event_callback(void *context)
 static void __set_size(struct mapped_device *md, sector_t size)
 {
 	set_capacity(md->disk, size);
-
-	mutex_lock(&md->bdev->bd_inode->i_mutex);
-	i_size_write(md->bdev->bd_inode, (loff_t)size << SECTOR_SHIFT);
-	mutex_unlock(&md->bdev->bd_inode->i_mutex);
+	revalidate_disk(md->disk);
 }
 
 /*

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

end of thread, other threads:[~2010-11-03 18:06 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-19 22:07 [PATCH] dm: use revalidate_disk to update device size after set_capacity Mike Snitzer
2010-10-20  5:42 ` Jun'ichi Nomura
2010-10-28  1:16   ` Mike Snitzer
2010-10-28 12:15     ` Jun'ichi Nomura
2010-10-28 19:54       ` Mike Snitzer
2010-10-28 22:18         ` Mike Snitzer
2010-10-29  3:00         ` Jun'ichi Nomura
2010-10-29 21:50 ` dm: lock bd_mutex when setting device size Mike Snitzer
2010-11-01  7:19   ` Jun'ichi Nomura
2010-11-01 13:14     ` Mike Snitzer
2010-11-03 18:06       ` [PATCH] dm: remove extra locking when changing " Mike Snitzer

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.