LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   k3b problem and patch?? (https://www.linuxquestions.org/questions/linux-newbie-8/k3b-problem-and-patch-291585/)

wrat 02-17-2005 06:48 PM

k3b problem and patch??
 
how does this patch work??
--- linux-2.6.11-mm1/drivers/block/scsi_ioctl.c.orig 2005-01-17 20:42:40.000000000 +0100
+++ linux-2.6.11-mm1/drivers/block/scsi_ioctl.c 2005-01-17 20:43:14.000000000 +0100
@@ -197,9 +197,7 @@ static int verify_command(struct file *f
if (type & CMD_WRITE_SAFE) {
if (file->f_mode & FMODE_WRITE)
return 0;
- }
-
- if (!(type & CMD_WARNED)) {
+ } else if (!(type & CMD_WARNED)) {
cmd_type[cmd[0]] = CMD_WARNED;
printk(KERN_WARNING "scsi: unknown opcode 0x%02x\n", cmd[0]);
}

paxa 02-18-2005 04:22 AM

--- linux-2.6.11-mm1/drivers/block/scsi_ioctl.c.orig 2005-01-17 20:42:40.000000000 +0100

Above line is replaced with...

+++ linux-2.6.11-mm1/drivers/block/scsi_ioctl.c 2005-01-17 20:43:14.000000000 +0100

@@ -197,9 +197,7 @@

Above line is a pointer to a line and row in file scsi_ioctl.c...

static int verify_command(struct file *f
if (type & CMD_WRITE_SAFE) {
if (file->f_mode & FMODE_WRITE)
return 0;
}

if (!(type & CMD_WARNED)) {
cmd_type[cmd[0]] = CMD_WARNED;
printk(KERN_WARNING "scsi: unknown opcode 0x%02x\n", cmd[0]);
}

Above function is replaced with...

static int verify_command(struct file *f
if (type & CMD_WRITE_SAFE) {
if (file->f_mode & FMODE_WRITE)
return 0;
} else if (!(type & CMD_WARNED)) {
cmd_type[cmd[0]] = CMD_WARNED;
printk(KERN_WARNING "scsi: unknown opcode 0x%02x\n", cmd[0]);
}

The change connects the first if statement with the last with an else condition and makes the second if dependant on the first.

amosf 02-18-2005 04:32 AM

This is a kernel patch to allow k3b and dvdtools to work with the newer kernels... There are problems with k3b and dvdtools in that they do not send correct commands, which are stopped by the kernal protection - to stop them possibly damaging drives as happened in the past. You could try to get the latest versions of k3b and dvdtools as they may be patched by now... Otherwise you need to edit the kernel (I do it slightly differently than the above, but similar) and recompile...


All times are GMT -5. The time now is 12:40 PM.