lkml.org 
[lkml]   [2002]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] IDE cleanup (1.612) broke all fdisks I have...
Hi Al,
it is nice that blkdev_ioctl calls blk_ioctl itself, but unfortunately
it does that only if driver's ioctl returns -EINVAL - and IDE returns -EIO :-(

Patch below is tested for disks - I do not have IDE floppy nor IDE tape.

I have couple of additional questions:
(1) should not we use -ENOTTY for unimplemented ioctl, like other subsystems do?
(2) IDE returns -EIO also for default_open. -ENXIO/-ENODEV?
(3) if drive->driver == NULL, ioctl returns -EPERM. I believe that this check
is not needed because of ide_open checks for drive->driver != NULL. And
if we can invoke ide's ioctl without previous open, should not we return
-ENODEV?
Thanks,
Petr Vandrovec
vandrove@vc.cvut.cz

diff -urN linux-2.5.33-c615.dist/drivers/ide/ide-floppy.c linux-2.5.33-c615/drivers/ide/ide-floppy.c
--- linux-2.5.33-c615.dist/drivers/ide/ide-floppy.c 2002-09-05 14:40:47.000000000 +0200
+++ linux-2.5.33-c615/drivers/ide/ide-floppy.c 2002-09-05 20:06:24.000000000 +0200
@@ -1817,7 +1817,7 @@
return (idefloppy_get_format_progress(drive, inode, file,
(int *)arg));
}
- return -EIO;
+ return -EINVAL;
}

/*
diff -urN linux-2.5.33-c615.dist/drivers/ide/ide-tape.c linux-2.5.33-c615/drivers/ide/ide-tape.c
--- linux-2.5.33-c615.dist/drivers/ide/ide-tape.c 2002-09-05 14:40:43.000000000 +0200
+++ linux-2.5.33-c615/drivers/ide/ide-tape.c 2002-09-05 20:06:11.000000000 +0200
@@ -4365,7 +4365,7 @@
return -EFAULT;
break;
default:
- return -EIO;
+ return -EINVAL;
}
return 0;
}
diff -urN linux-2.5.33-c615.dist/drivers/ide/ide.c linux-2.5.33-c615/drivers/ide/ide.c
--- linux-2.5.33-c615.dist/drivers/ide/ide.c 2002-09-05 14:40:42.000000000 +0200
+++ linux-2.5.33-c615/drivers/ide/ide.c 2002-09-05 19:58:15.000000000 +0200
@@ -3347,7 +3347,7 @@
static int default_ioctl (ide_drive_t *drive, struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
- return -EIO;
+ return -EINVAL;
}

static int default_open (struct inode *inode, struct file *filp, ide_drive_t *drive)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:28    [W:0.065 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site