linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* fix block device size update serialization
@ 2020-08-21  8:55 Christoph Hellwig
  2020-08-21  8:55 ` [PATCH 1/2] block: replace bd_set_size with bd_set_nr_sectors Christoph Hellwig
  2020-08-21  8:56 ` [PATCH 2/2] block: fix locking for struct block_device size updates Christoph Hellwig
  0 siblings, 2 replies; 6+ messages in thread
From: Christoph Hellwig @ 2020-08-21  8:55 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Justin Sanders, Josef Bacik, Xianting Tian, linux-block,
	dm-devel, Stefan Haberland, Jan Hoeppner, linux-kernel, nbd,
	linux-nvme, linux-s390

Hi Jens,

this series fixes how we update i_size for the block device inodes (and
thus the block device).  Different helpers use two different locks
(bd_mutex and i_rwsem) to protect the update, and it appears device
mapper uses yet another internal lock.  A lot of the drivers do the
update handcrafted in often crufty ways.  And in addition to that mess
it turns out that the "main" lock, bd_mutex is pretty dead lock prone
vs other spots in the block layer that acquire it during revalidation
operations, as reported by Xianting.

Fix all that by adding a dedicated spinlock just for the size updates.

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

end of thread, other threads:[~2020-08-23  9:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-21  8:55 fix block device size update serialization Christoph Hellwig
2020-08-21  8:55 ` [PATCH 1/2] block: replace bd_set_size with bd_set_nr_sectors Christoph Hellwig
2020-08-21  9:24   ` Hannes Reinecke
2020-08-21  8:56 ` [PATCH 2/2] block: fix locking for struct block_device size updates Christoph Hellwig
2020-08-21  9:26   ` Hannes Reinecke
     [not found]     ` <133efc8b.1649.17410784734.Coremail.xianting_tian@126.com>
2020-08-23  9:09       ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).