From: Finn Thain <fthain@linux-m68k.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: Laurent Vivier <laurent@vivier.eu>,
Stan Johnson <userm57@yahoo.com>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Joshua Thompson <funaho@jurai.org>,
linux-block@vger.kernel.org, linux-m68k@lists.linux-m68k.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] swim: Return -EROFS when opened with BLK_OPEN_WRITE flag
Date: Sat, 26 Sep 2026 17:39:23 +1000 [thread overview]
Message-ID: <ef4368d696b4b68ea3f288327432f4027afcca81.1790408363.git.fthain@linux-m68k.org> (raw)
In-Reply-To: <cover.1790408363.git.fthain@linux-m68k.org>
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: 8852ecd97488 ("m68k: mac - Add SWIM floppy support")
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
---
drivers/block/swim.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index 0ccc12a72388..601b1ab1d32c 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -640,7 +640,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;
}
--
2.52.0
next prev parent reply other threads:[~2026-09-26 7:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-26 7:39 [PATCH 0/2] block/swim: Minor fixes Finn Thain
2026-09-26 7:39 ` [PATCH 2/2] swim, swim3: Fix FDEJECT ioctl for exclusive open Finn Thain
2026-09-27 5:58 ` Finn Thain
2026-09-26 7:39 ` Finn Thain [this message]
2026-09-27 18:27 ` [PATCH 0/2] block/swim: Minor fixes Stanley J. Johnson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ef4368d696b4b68ea3f288327432f4027afcca81.1790408363.git.fthain@linux-m68k.org \
--to=fthain@linux-m68k.org \
--cc=axboe@kernel.dk \
--cc=funaho@jurai.org \
--cc=geert@linux-m68k.org \
--cc=laurent@vivier.eu \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=userm57@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®