forked from Minki/linux
s390/dasd: fix ioctl return value
For unimplemented ioctls the dasd driver should return -ENOTTY. Reported-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> Acked-by: Stefan Weinhuber <wein@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
parent
cbe05685c1
commit
6b79d14e7a
@ -3804,7 +3804,7 @@ dasd_eckd_ioctl(struct dasd_block *block, unsigned int cmd, void __user *argp)
|
||||
case BIODASDSYMMIO:
|
||||
return dasd_symm_io(device, argp);
|
||||
default:
|
||||
return -ENOIOCTLCMD;
|
||||
return -ENOTTY;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -498,12 +498,9 @@ int dasd_ioctl(struct block_device *bdev, fmode_t mode,
|
||||
break;
|
||||
default:
|
||||
/* if the discipline has an ioctl method try it. */
|
||||
if (base->discipline->ioctl) {
|
||||
rc = -ENOTTY;
|
||||
if (base->discipline->ioctl)
|
||||
rc = base->discipline->ioctl(block, cmd, argp);
|
||||
if (rc == -ENOIOCTLCMD)
|
||||
rc = -EINVAL;
|
||||
} else
|
||||
rc = -EINVAL;
|
||||
}
|
||||
dasd_put_device(base);
|
||||
return rc;
|
||||
|
Loading…
Reference in New Issue
Block a user