heicars2@xxxxxxxxxxxxxxxxxx wrote on 2012-08-27 11:03:55: [..] > > Thanks, but you missed the else path. I'm going to commit the patch below > unless Stefan has any objections: > > From dac16bd8b314dc6f3f4e6815feab199fdfc8cddd Mon Sep 17 00:00:00 2001 > From: Heiko Carstens <heiko.carstens@xxxxxxxxxx> > Date: Mon, 27 Aug 2012 10:59:42 +0200 > Subject: [PATCH] s390/dasd: fix ioctl return value > > For unimplemented ioctls the dasd driver should return -ENOTTY. > > Reported-by: Wanlong Gao <gaowanlong@xxxxxxxxxxxxxx> > Signed-off-by: Heiko Carstens <heiko.carstens@xxxxxxxxxx> > --- > drivers/s390/block/dasd_eckd.c | 2 +- > drivers/s390/block/dasd_ioctl.c | 7 ++----- > 2 files changed, 3 insertions(+), 6 deletions(-) > > diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c > index 40a826a..2fb2b9e 100644 > --- a/drivers/s390/block/dasd_eckd.c > +++ b/drivers/s390/block/dasd_eckd.c > @@ -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; > } > } > > diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c > index cceae70..654c692 100644 > --- a/drivers/s390/block/dasd_ioctl.c > +++ b/drivers/s390/block/dasd_ioctl.c > @@ -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; > -- > 1.7.11.5 > The patch is looking fine to me, thanks. Mit freundlichen Grüßen / Kind regards Stefan Weinhuber -- To unsubscribe from this list: send the line "unsubscribe linux-s390" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html