Repository navigation
Commit e6732e0
floppy: bail out in open() if drive is not responding to block0 read
commit 7b7b68b 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>1 parent 3042adc commit e6732e0
2 files changed
Lines changed: 29 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3691 | 3691 | | |
3692 | 3692 | | |
3693 | 3693 | | |
| 3694 | + | |
3694 | 3695 | | |
3695 | 3696 | | |
3696 | 3697 | | |
| 3698 | + | |
| 3699 | + | |
3697 | 3700 | | |
3698 | 3701 | | |
3699 | 3702 | | |
| |||
3746 | 3749 | | |
3747 | 3750 | | |
3748 | 3751 | | |
3749 | | - | |
| 3752 | + | |
| 3753 | + | |
| 3754 | + | |
| 3755 | + | |
| 3756 | + | |
| 3757 | + | |
3750 | 3758 | | |
3751 | | - | |
| 3759 | + | |
| 3760 | + | |
| 3761 | + | |
| 3762 | + | |
| 3763 | + | |
| 3764 | + | |
| 3765 | + | |
| 3766 | + | |
3752 | 3767 | | |
3753 | 3768 | | |
3754 | | - | |
| 3769 | + | |
3755 | 3770 | | |
3756 | 3771 | | |
3757 | 3772 | | |
3758 | | - | |
3759 | 3773 | | |
| 3774 | + | |
3760 | 3775 | | |
3761 | 3776 | | |
3762 | 3777 | | |
| |||
3769 | 3784 | | |
3770 | 3785 | | |
3771 | 3786 | | |
| 3787 | + | |
| 3788 | + | |
3772 | 3789 | | |
3773 | 3790 | | |
3774 | 3791 | | |
| |||
3779 | 3796 | | |
3780 | 3797 | | |
3781 | 3798 | | |
3782 | | - | |
3783 | | - | |
3784 | | - | |
| 3799 | + | |
| 3800 | + | |
3785 | 3801 | | |
3786 | 3802 | | |
3787 | 3803 | | |
3788 | | - | |
| 3804 | + | |
| 3805 | + | |
| 3806 | + | |
3789 | 3807 | | |
3790 | 3808 | | |
3791 | 3809 | | |
| |||
3827 | 3845 | | |
3828 | 3846 | | |
3829 | 3847 | | |
3830 | | - | |
| 3848 | + | |
3831 | 3849 | | |
3832 | 3850 | | |
3833 | 3851 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
| 188 | + | |
| 189 | + | |
189 | 190 | | |
190 | 191 | | |
191 | 192 | | |
| |||
0 commit comments