Re: [dm-devel] [PATCH 2/2] block: fix locking for struct block_device size updates

2020-08-23 Thread Christoph Hellwig
On Fri, Aug 21, 2020 at 06:02:32PM +0800, 田 wrote: > thanks Hellwig for your kindly reply and your fix and add report by me :) I found an issue with the patch, and will send a new version in a bit. If this works for your reproducer, can you add a Tested-by: tag? -- dm-devel mailing list dm-devel

[dm-devel] [PATCH 2/3] block: fix locking for struct block_device size updates

2020-08-23 Thread Christoph Hellwig
Two different callers use two different mutexes for updating the block device size, which obviously doesn't help to actually protect against concurrent updates from the different callers. In addition one of the locks, bd_mutex is rather prone to deadlocks with other parts of the block stack that u

[dm-devel] fix block device size update serialization v2

2020-08-23 Thread Christoph Hellwig
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 handcra

[dm-devel] [PATCH 1/3] block: replace bd_set_size with bd_set_nr_sectors

2020-08-23 Thread Christoph Hellwig
Replace bd_set_size with a version that takes the number of sectors instead, as that fits most of the current and future callers much better. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/block/loop.c | 4 ++-- drivers/block/nbd.c | 7 --- drivers/bloc

[dm-devel] [PATCH 3/3] nvme: don't call revalidate_disk from nvme_set_queue_dying

2020-08-23 Thread Christoph Hellwig
In nvme_set_queue_dying we really just want to ensure the disk and bdev sizes are set to zero. Going through revalidate_disk leads to a somewhat arcance and complex callchain relying on special behavior in a few places. Instead just lift the set_capacity directly to nvme_set_queue_dying, and rena

Re: [dm-devel] [PATCH] dm-crypt: Document new no_workqueue flags.

2020-08-23 Thread Damien Le Moal
On 2020/08/21 2:46, Milan Broz wrote: > Patch 39d42fa96ba1b7d2544db3f8ed5da8fb0d5cb877 introduced new > dm-crypt no_read_workqueue and no_write_workqueue flags. > > This patch adds documentation to admin guide for them. > > Signed-off-by: Milan Broz > --- > Documentation/admin-guide/device-mapp

Re: [dm-devel] [PATCH] dm-crypt: Document new no_workqueue flags.

2020-08-23 Thread Milan Broz
On 24/08/2020 03:15, Damien Le Moal wrote: > On 2020/08/21 2:46, Milan Broz wrote: >> Patch 39d42fa96ba1b7d2544db3f8ed5da8fb0d5cb877 introduced new >> dm-crypt no_read_workqueue and no_write_workqueue flags. >> >> This patch adds documentation to admin guide for them. >> >> Signed-off-by: Milan Bro