mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
swim: Return -EROFS when opened with BLK_OPEN_WRITE flag
Write requests are not supported by the driver and produce IO errors as
shown below. Avoid this by returning -EROFS when opened for writing.
[ 4111.690000] I/O error, dev fd0, sector 2 op 0x1:(WRITE) flags 0x800800 phys_seg 1 prio class 2
[ 4111.700000] Buffer I/O error on dev fd0, logical block 2, lost async page write
Fixes: 8852ecd974 ("m68k: mac - Add SWIM floppy support")
Tested-by: Stan Johnson <userm57@yahoo.com>
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Link: https://patch.msgid.link/327be6ca3c92c3411b5dfaeede014ed65a2d0f0f.1790641175.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
e7a6727dea
commit
d8fe777978
|
|
@ -639,7 +639,8 @@ static int floppy_open(struct gendisk *disk, blk_mode_t mode)
|
|||
if (mode & (BLK_OPEN_READ | BLK_OPEN_WRITE)) {
|
||||
if (disk_check_media_change(disk) && fs->disk_in)
|
||||
fs->ejected = 0;
|
||||
if ((mode & BLK_OPEN_WRITE) && fs->write_protected) {
|
||||
if (mode & BLK_OPEN_WRITE) {
|
||||
/* Write support isn't implemented. */
|
||||
err = -EROFS;
|
||||
goto out;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user