Revert "floppy: fix open(O_ACCMODE) for ioctl-only open"
This reverts commit ff06db1efb
.
This commit is contained in:
parent
5bb53c0fb8
commit
468c298ad3
|
@ -3663,6 +3663,11 @@ static int floppy_open(struct block_device *bdev, fmode_t mode)
|
||||||
|
|
||||||
opened_bdev[drive] = bdev;
|
opened_bdev[drive] = bdev;
|
||||||
|
|
||||||
|
if (!(mode & (FMODE_READ|FMODE_WRITE))) {
|
||||||
|
res = -EINVAL;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
res = -ENXIO;
|
res = -ENXIO;
|
||||||
|
|
||||||
if (!floppy_track_buffer) {
|
if (!floppy_track_buffer) {
|
||||||
|
@ -3706,7 +3711,6 @@ static int floppy_open(struct block_device *bdev, fmode_t mode)
|
||||||
if (UFDCS->rawcmd == 1)
|
if (UFDCS->rawcmd == 1)
|
||||||
UFDCS->rawcmd = 2;
|
UFDCS->rawcmd = 2;
|
||||||
|
|
||||||
if (mode & (FMODE_READ|FMODE_WRITE)) {
|
|
||||||
UDRS->last_checked = 0;
|
UDRS->last_checked = 0;
|
||||||
clear_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags);
|
clear_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags);
|
||||||
check_disk_change(bdev);
|
check_disk_change(bdev);
|
||||||
|
@ -3714,7 +3718,6 @@ static int floppy_open(struct block_device *bdev, fmode_t mode)
|
||||||
goto out;
|
goto out;
|
||||||
if (test_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags))
|
if (test_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags))
|
||||||
goto out;
|
goto out;
|
||||||
}
|
|
||||||
|
|
||||||
res = -EROFS;
|
res = -EROFS;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue