Commit 6b79d14e authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky

s390/dasd: fix ioctl return value

For unimplemented ioctls the dasd driver should return -ENOTTY.
Reported-by: default avatarWanlong Gao <gaowanlong@cn.fujitsu.com>
Acked-by: default avatarStefan Weinhuber <wein@de.ibm.com>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent cbe05685
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment