]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
floppy: fix for PAGE_SIZE != 4KB
authorRene Rebe <rene@exactco.de>
Fri, 14 Nov 2025 13:41:27 +0000 (14:41 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Jan 2026 11:57:08 +0000 (12:57 +0100)
commit3312f03e9948ce538800cd5ca5d4bf3370e9da8f
treedbdb86521d9ea6df8811f1676700b01546bd5833
parentcbaae7bb64d40e49928e3428faa7a5c3d0217ee7
floppy: fix for PAGE_SIZE != 4KB

commit 82d20481024cbae2ea87fe8b86d12961bfda7169 upstream.

For years I wondered why the floppy driver does not just work on
sparc64, e.g:

root@SUNW_375_0066:# disktype /dev/fd0
disktype: Can't open /dev/fd0: No such device or address

[  525.341906] disktype: attempt to access beyond end of device
fd0: rw=0, sector=0, nr_sectors = 16 limit=8
[  525.341991] floppy: error 10 while reading block 0

Turns out floppy.c __floppy_read_block_0 tries to read one page for
the first test read to determine the disk size and thus fails if that
is greater than 4k. Adjust minimum MAX_DISK_SIZE to PAGE_SIZE to fix
floppy on sparc64 and likely all other PAGE_SIZE != 4KB configs.

Cc: stable@vger.kernel.org
Signed-off-by: René Rebe <rene@exactco.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/block/floppy.c