summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2014-01-10 02:08:13 +0100
committerJiri Slaby <jslaby@suse.cz>2014-04-18 10:58:54 +0200
commite6732e00c9ffc318d21fca56e747f59f85d078a1 (patch)
tree07dafe5224022dd4d63c934aeaeeb3141b67e2d2 /include
parent3042adcc664cb8ec04af94c04ad00c87c94a8288 (diff)
floppy: bail out in open() if drive is not responding to block0 read
commit 7b7b68bba5ef23734c35ffb0d8d82079ed604d33 upstream. In case reading of block 0 during open() fails, it is not the right thing to let open() succeed. Fix this by introducing FD_OPEN_SHOULD_FAIL_BIT flag, and setting it in case the bio callback encounters an error while trying to read block 0. As a bonus, this works around certain broken userspace (blkid), which is not able to properly handle read()s returning IO errors. Hence be nice to those, and bail out during open() already; if block 0 is not readable, read()s are not going to provide any meaningful data anyway. Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'include')
-rw-r--r--include/uapi/linux/fd.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/uapi/linux/fd.h b/include/uapi/linux/fd.h
index f1f3dd5981b2..84c517cbce90 100644
--- a/include/uapi/linux/fd.h
+++ b/include/uapi/linux/fd.h
@@ -185,7 +185,8 @@ enum {
* to clear media change status */
FD_UNUSED_BIT,
FD_DISK_CHANGED_BIT, /* disk has been changed since last i/o */
- FD_DISK_WRITABLE_BIT /* disk is writable */
+ FD_DISK_WRITABLE_BIT, /* disk is writable */
+ FD_OPEN_SHOULD_FAIL_BIT
};
#define FDSETDRVPRM _IOW(2, 0x90, struct floppy_drive_params)