public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ondrej Zary <linux@rainbow-software.org>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: ide-floppy - software eject not working with LS-120 drive
Date: Sun, 04 Sep 2005 17:54:58 +0200	[thread overview]
Message-ID: <431B18D2.2000708@rainbow-software.org> (raw)
In-Reply-To: <200509031801.11356.vda@ilport.com.ua>

[-- Attachment #1: Type: text/plain, Size: 971 bytes --]

Denis Vlasenko wrote:
> On Friday 02 September 2005 23:47, Ondrej Zary wrote:
> 
>>Hello,
>>I've bought "new" LS-120 drive and found that software eject does not 
>>work with 2.6.13 kernel:
>>root@pentium:~# eject /dev/hdc
>>eject: unable to eject, last error: Invalid argument
>>
>>The drive spins up and after a while the command fails.
>>This appears in dmesg after each eject attempt:
>>  hdc: unknown partition table
>>ide-floppy: hdc: I/O error, pc = 1b, key =  5, asc = 24, ascq =  0
>>
>>When I boot 2.4.31, eject works fine.
> 
> 
> Can you probive something narrower than 2.4.31 -> 2.6.13 jump?

The problem is caused by idefloppy_ioctl() function which *first* tries
generic_ide_ioctl() and *only* if it fails with -EINVAL, proceeds with
the specific ioctls.
This patch fixes it by first going through the internal ioctls and only
trying generic_ide_ioctl() if none of them matches.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>

-- 
Ondrej Zary




[-- Attachment #2: ide-floppy-eject.patch --]
[-- Type: text/plain, Size: 799 bytes --]

--- linux-2.6.13-orig/drivers/ide/ide-floppy.c	2005-08-29 01:41:01.000000000 +0200
+++ linux-2.6.13-pentium/drivers/ide/ide-floppy.c	2005-09-04 14:07:53.000000000 +0200
@@ -2038,11 +2038,9 @@
 	struct ide_floppy_obj *floppy = ide_floppy_g(bdev->bd_disk);
 	ide_drive_t *drive = floppy->drive;
 	void __user *argp = (void __user *)arg;
-	int err = generic_ide_ioctl(drive, file, bdev, cmd, arg);
+	int err;
 	int prevent = (arg) ? 1 : 0;
 	idefloppy_pc_t pc;
-	if (err != -EINVAL)
-		return err;
 
 	switch (cmd) {
 	case CDROMEJECT:
@@ -2094,7 +2092,7 @@
 	case IDEFLOPPY_IOCTL_FORMAT_GET_PROGRESS:
 		return idefloppy_get_format_progress(drive, argp);
 	}
- 	return -EINVAL;
+	return generic_ide_ioctl(drive, file, bdev, cmd, arg);
 }
 
 static int idefloppy_media_changed(struct gendisk *disk)




      parent reply	other threads:[~2005-09-04 15:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-02 20:47 ide-floppy - software eject not working with LS-120 drive Ondrej Zary
     [not found] ` <200509031801.11356.vda@ilport.com.ua>
2005-09-04 15:54   ` Ondrej Zary [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=431B18D2.2000708@rainbow-software.org \
    --to=linux@rainbow-software.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox