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
2 changed files with 3 additions and 6 deletions
|
@ -3804,7 +3804,7 @@ dasd_eckd_ioctl(struct dasd_block *block, unsigned int cmd, void __user *argp)
|
||||||
case BIODASDSYMMIO:
|
case BIODASDSYMMIO:
|
||||||
return dasd_symm_io(device, argp);
|
return dasd_symm_io(device, argp);
|
||||||
default:
|
default:
|
||||||
return -ENOIOCTLCMD;
|
return -ENOTTY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -498,12 +498,9 @@ int dasd_ioctl(struct block_device *bdev, fmode_t mode,
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* if the discipline has an ioctl method try it. */
|
/* 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);
|
rc = base->discipline->ioctl(block, cmd, argp);
|
||||||
if (rc == -ENOIOCTLCMD)
|
|
||||||
rc = -EINVAL;
|
|
||||||
} else
|
|
||||||
rc = -EINVAL;
|
|
||||||
}
|
}
|
||||||
dasd_put_device(base);
|
dasd_put_device(base);
|
||||||
return rc;
|
return rc;
|
||||||
|
|
Loading…
Add table
Reference in a new issue