This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / drivers / ide / ide-tape.c
index d19ee54..480426f 100644 (file)
@@ -3755,6 +3755,10 @@ static ssize_t idetape_chrdev_read (struct file *file, char __user *buf,
        idetape_tape_t *tape = drive->driver_data;
        ssize_t bytes_read,temp, actually_read = 0, rc;
 
+       if (ppos != &file->f_pos) {
+               /* "A request was outside the capabilities of the device." */
+               return -ENXIO;
+       }
 #if IDETAPE_DEBUG_LOG
        if (tape->debug_level >= 3)
                printk(KERN_INFO "ide-tape: Reached idetape_chrdev_read, count %Zd\n", count);
@@ -3814,6 +3818,11 @@ static ssize_t idetape_chrdev_write (struct file *file, const char __user *buf,
        idetape_tape_t *tape = drive->driver_data;
        ssize_t retval, actually_written = 0;
 
+       if (ppos != &file->f_pos) {
+               /* "A request was outside the capabilities of the device." */
+               return -ENXIO;
+       }
+
        /* The drive is write protected. */
        if (tape->write_prot)
                return -EACCES;
@@ -4178,7 +4187,6 @@ static int idetape_chrdev_open (struct inode *inode, struct file *filp)
        idetape_pc_t pc;
        int retval;
 
-       nonseekable_open(inode, filp);
 #if IDETAPE_DEBUG_LOG
        printk(KERN_INFO "ide-tape: Reached idetape_chrdev_open\n");
 #endif /* IDETAPE_DEBUG_LOG */
@@ -4807,7 +4815,7 @@ static int idetape_ioctl(struct inode *inode, struct file *file,
 {
        struct block_device *bdev = inode->i_bdev;
        ide_drive_t *drive = bdev->bd_disk->private_data;
-       int err = generic_ide_ioctl(file, bdev, cmd, arg);
+       int err = generic_ide_ioctl(bdev, cmd, arg);
        if (err == -EINVAL)
                err = idetape_blkdev_ioctl(drive, cmd, arg);
        return err;