Re: [dm-devel] [PATCH 6/6] nvme: allow revalidate to set a namespace read-only

2021-01-09 Thread Chaitanya Kulkarni
On 1/9/21 02:49, Christoph Hellwig wrote: > Unconditionally call set_disk_ro now that it only updates the hardware > state. This allows to properly set up the Linux devices read-only when > the controller turns a previously writable namespace read-only. > > Signed-off-by: Christoph Hellwig > Revi

Re: [dm-devel] [PATCH 2/6] block: remove the NULL bdev check in bdev_read_only

2021-01-09 Thread Chaitanya Kulkarni
On 1/9/21 02:48, Christoph Hellwig wrote: > Only a single caller can end up in bdev_read_only, so move the check > there. > > Signed-off-by: Christoph Hellwig > Reviewed-by: Ming Lei > Reviewed-by: Martin K. Petersen Looks good. Reviewed-by: Chaitanya Kulkarni -- dm-devel mailing list dm-d

[dm-devel] [PATCH] dm crypt: do not call bio_endio() from the dm-crypt tasklet

2021-01-09 Thread Ignat Korchagin
Sometimes, when dm-crypt executes decryption in a tasklet, we may get the following on a kasan-enabled kernel: [ 397.613621][ C74] == [ 397.621794][ C74] BUG: KASAN: use-after-free in tasklet_action_common.constprop.0+0x151/0x

[dm-devel] split hard read-only vs read-only policy v3 (resend)

2021-01-09 Thread Christoph Hellwig
Hi Jens, this series resurrects a patch from Martin to properly split the flag indicating a disk has been set read-only by the hardware vs the userspace policy set through the BLKROSET ioctl. Note that the last patch only applies to for-next and not to for-5.11/block. I can hold it back for the

[dm-devel] [PATCH 6/6] nvme: allow revalidate to set a namespace read-only

2021-01-09 Thread Christoph Hellwig
Unconditionally call set_disk_ro now that it only updates the hardware state. This allows to properly set up the Linux devices read-only when the controller turns a previously writable namespace read-only. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Martin K. Petersen

[dm-devel] [PATCH 5/6] rbd: remove the ->set_read_only method

2021-01-09 Thread Christoph Hellwig
Now that the hardware read-only state can't be changed by the BLKROSET ioctl, the code in this method is not required anymore. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Acked-by: Ilya Dryomov Reviewed-by: Martin K. Petersen --- drivers/block/rbd.c | 19 ---

[dm-devel] [PATCH 4/6] block: propagate BLKROSET on the whole device to all partitions

2021-01-09 Thread Christoph Hellwig
Change the policy so that a BLKROSET on the whole device also affects partitions. To quote Martin K. Petersen: It's very common for database folks to twiddle the read-only state of block devices and partitions. I know that our users will find it very counter-intuitive that setting /dev/sda read-o

[dm-devel] [PATCH 3/6] block: add a hard-readonly flag to struct gendisk

2021-01-09 Thread Christoph Hellwig
Commit 20bd1d026aac ("scsi: sd: Keep disk read-only when re-reading partition") addressed a long-standing problem with user read-only policy being overridden as a result of a device-initiated revalidate. The commit has since been reverted due to a regression that left some USB devices read-only ind

[dm-devel] [PATCH 2/6] block: remove the NULL bdev check in bdev_read_only

2021-01-09 Thread Christoph Hellwig
Only a single caller can end up in bdev_read_only, so move the check there. Signed-off-by: Christoph Hellwig Reviewed-by: Ming Lei Reviewed-by: Martin K. Petersen --- block/genhd.c | 3 --- fs/super.c| 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/block/genhd.c b/bl

[dm-devel] [PATCH 1/6] dm: use bdev_read_only to check if a device is read-only

2021-01-09 Thread Christoph Hellwig
dm-thin and dm-cache also work on partitions, so use the proper interface to check if the device is read-only. Signed-off-by: Christoph Hellwig Reviewed-by: Ming Lei Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke --- drivers/md/dm-cache-metadata.c | 2 +- drivers/md/dm-thin-meta