Bug 153981

Summary: floppy.c broken, causing failure to start VirtualBox VM on floppy-fitted computers
Product: Drivers Reporter: reserv0
Component: OtherAssignee: drivers_other
Status: RESOLVED CODE_FIX    
Severity: high    
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 4.6.0 to 4.7.3 Subsystem:
Regression: Yes Bisected commit-id:
Attachments: Floppy driver fix for Linux kernel v4.7.2
Patch for v4.7.0/1/3 and v4.6.*

Description reserv0 2016-08-25 22:11:09 UTC
Created attachment 230271 [details]
Floppy driver fix for Linux kernel v4.7.2

When I updated from Linux kernel v4.1 to v4.6, I got hit by a bug in the floppy driver, which causes failures to start VirtualBox VMs (full bug report available here: https://www.virtualbox.org/ticket/15581 ).

The VirtualBox team seems to consider it a kernel bug, and I produced a patch which reverts the floppy.c driver to its v4.1 behaviour (while keeping the required changes for kernel v4.7.2). See the attached patch.

Not being a Linux kernel developer and lacking time, I didn't bother investigating deeper the reasons for that bug (all what matters for me is that Linux works again as it used to with older kernels, with regards to floppy & VirtualBox).
Comment 1 reserv0 2016-09-09 08:44:52 UTC
Created attachment 232811 [details]
Patch for v4.7.0/1/3 and v4.6.*
Comment 2 reserv0 2016-09-09 08:45:06 UTC
Kernel v4.7.3 floppy driver is still broken, but it got "floppy: fix open(O_ACCMODE) for ioctl-only open" reverted (reversion commit is 0e0af957499ee15afb7e0ce2e9fa83b5708808fd), I'm attaching a new patch that applies to v4.7.3 (and all other v4.6 and 4.7 versions).

I'm also marking this bug as a regression, which it is.
Comment 3 reserv0 2016-09-15 07:59:36 UTC
Good news !

Linux kernel v4.7.4 finally reverted the culprit code (commit a15f1d0d13bee12b54e198286b91a83752f45b07): Revert "floppy: refactor open() flags handling"

This bug is now fixed.