[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 3/6] block: add a hard-readonly flag to struct gendisk

2020-12-08 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

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

2020-12-08 Thread Christoph Hellwig
On Tue, Dec 08, 2020 at 06:22:11PM +0800, Ming Lei wrote: > > int bdev_read_only(struct block_device *bdev) > > { > > - return bdev->bd_read_only; > > + return bdev->bd_read_only || > > + test_bit(GD_READ_ONLY, &bdev->bd_disk->state); > > } > > EXPORT_SYMBOL(bdev_read_only); > >

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

2020-12-08 Thread Ming Lei
On Mon, Dec 07, 2020 at 02:19:15PM +0100, Christoph Hellwig wrote: > 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

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

2020-12-07 Thread Martin K. Petersen
Christoph, > diff --git a/block/blk-core.c b/block/blk-core.c > index ad041e903b0a8f..ecd68415c6acad 100644 > --- a/block/blk-core.c > +++ b/block/blk-core.c > @@ -693,7 +693,7 @@ static inline bool should_fail_request(struct > block_device *part, > > static inline bool bio_check_ro(struct b

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

2020-12-07 Thread Martin K. Petersen
Christoph, > 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 > U

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

2020-12-07 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