Commit 2201b74f authored by Peter Osterlund's avatar Peter Osterlund Committed by Linus Torvalds

[PATCH] Incorrect timeout in CDROM_SEND_PACKET ioctl

The CDROM_SEND_PACKET ioctl passes a struct cdrom_generic_command from
user space, which contains a timeout field.

The timeout is measured in jiffies, but the conversion from user to
kernel jiffies is missing, which makes the timeout 10 times shorter than
it should be in 2.5 kernels on x86.  This causes CDRW formatting with
cdrwtool to fail.  The following patch fixes this problem.
parent 42f77543
......@@ -268,6 +268,7 @@
#include <linux/init.h>
#include <linux/fcntl.h>
#include <linux/blkdev.h>
#include <linux/times.h>
#include <asm/uaccess.h>
......@@ -2171,6 +2172,7 @@ static int mmc_ioctl(struct cdrom_device_info *cdi, unsigned int cmd,
return -ENOSYS;
cdinfo(CD_DO_IOCTL, "entering CDROM_SEND_PACKET\n");
IOCTL_IN(arg, struct cdrom_generic_command, cgc);
cgc.timeout = clock_t_to_jiffies(cgc.timeout);
return cdrom_do_cmd(cdi, &cgc);
}
case CDROM_NEXT_WRITABLE: {
......
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