Romain Izard 78a8dfbabb ubi: Fix error for write access
When opening a device with write access, ubiblock_open returns an error
code. Currently, this error code is -EPERM, but this is not the right
value.

The open function for other block devices returns -EROFS when opening
read-only devices with FMODE_WRITE set. When used with dm-verity, the
veritysetup userspace tool is expecting EROFS, and refuses to use the
ubiblock device.

Use -EROFS for ubiblock as well. As a result, veritysetup accepts the
ubiblock device as valid.

Cc: stable@vger.kernel.org
Fixes: 9d54c8a33eec (UBI: R/O block driver on top of UBI volumes)
Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
2018-04-04 23:48:05 +02:00
..
2016-10-02 22:48:14 +02:00
2018-04-04 23:48:05 +02:00
2015-04-13 21:05:17 +02:00
2016-07-29 23:31:54 +02:00
2017-03-24 15:33:32 +01:00
2017-03-24 15:33:32 +01:00
2017-09-13 22:05:30 +02:00
2017-03-24 15:33:32 +01:00
2016-10-02 22:48:14 +02:00
2018-01-18 00:18:50 +01:00