Re: [PATCH v1 3/3] block: set partition read/write policy according to write-protection status

From: Christoph Hellwig
Date: Thu Mar 19 2020 - 06:25:41 EST


On Wed, Mar 04, 2020 at 10:51:14AM +0800, light.hsieh@xxxxxxxxxxxx wrote:
> From: Light Hsieh <light.hsieh@xxxxxxxxxxxx>
>
> For storage device with write-protection support, e.g. eMMC, register
> check_disk_range_wp() in struct block_device_operations for checking
> write-protection status. When creating block device for a partition, set
> read/write policy according to result of check_disk_range_wp() operation
> (if registered).
>
> Without this patch, ro attribute is not set for created block device of
> write-protected partition. User perform asynchronous buffered write to
> such partition won't get immediate error and therefore he won't be awared
> that write is not actually performed.
> With this patch, ro attribute is set for created block device of
> write-protected partition. User perform asynchronous buffered write to
> such partition will get immediate error and therefore he will be awared.

NAK. This is complete BS. Partitions are a complete software concepts
and idiotic features like a range read only should not interact with it
at all (and I urge all Linux users to never make use of such broken
features, so the less support we have for them, the better).