Re: [PATCH] Change paride driver to use unlocked_ioctl instead of ioctl

2008-01-10 Thread Alan Cox
On Thu, 10 Jan 2008 16:01:44 +0100 (CET) Jiri Kosina <[EMAIL PROTECTED]> wrote: > On Wed, 9 Jan 2008, Alan Cox wrote: > > > > > > default: > > > > > printk("%s: Unimplemented ioctl 0x%x\n", tape->name, > > > > > cmd); > > > > > + unlock_kernel(); > > > > >

Re: [PATCH] Change paride driver to use unlocked_ioctl instead of ioctl

2008-01-10 Thread Matthew Wilcox
On Thu, Jan 10, 2008 at 09:01:41PM +0530, Nikanth Karthikesan wrote: > On Thu, 2008-01-10 at 16:01 +0100, Jiri Kosina wrote: > > On Wed, 9 Jan 2008, Alan Cox wrote: > > > > > > > > default: > > > > > > printk("%s: Unimplemented ioctl 0x%x\n", tape->name, > > > > > > cmd); > > > >

Re: [PATCH] Change paride driver to use unlocked_ioctl instead of ioctl

2008-01-10 Thread Nikanth Karthikesan
On Thu, 2008-01-10 at 16:01 +0100, Jiri Kosina wrote: > On Wed, 9 Jan 2008, Alan Cox wrote: > > > > > > default: > > > > > printk("%s: Unimplemented ioctl 0x%x\n", tape->name, > > > > > cmd); > > > > > + unlock_kernel(); > > > > > return -EINVAL; > >

Re: [PATCH] Change paride driver to use unlocked_ioctl instead of ioctl

2008-01-10 Thread Jiri Kosina
On Wed, 9 Jan 2008, Alan Cox wrote: > > > > default: > > > > printk("%s: Unimplemented ioctl 0x%x\n", tape->name, > > > > cmd); > > > > + unlock_kernel(); > > > > return -EINVAL; > > > Surely a bug ... shouldn't this return -ENOTTY? > Agreed -

Re: [PATCH] Change paride driver to use unlocked_ioctl instead of ioctl

2008-01-09 Thread Nikanth Karthikesan
On Wed, 2008-01-09 at 16:56 +, Alan Cox wrote: > On Wed, 9 Jan 2008 14:26:26 +0100 (CET) > Jiri Kosina <[EMAIL PROTECTED]> wrote: > > > On Wed, 9 Jan 2008, Matthew Wilcox wrote: > > > > > > default: > > > > printk("%s: Unimplemented ioctl 0x%x\n", tape->name, > > > >

Re: [PATCH] Change paride driver to use unlocked_ioctl instead of ioctl

2008-01-09 Thread Alan Cox
On Wed, 9 Jan 2008 14:26:26 +0100 (CET) Jiri Kosina <[EMAIL PROTECTED]> wrote: > On Wed, 9 Jan 2008, Matthew Wilcox wrote: > > > > default: > > > printk("%s: Unimplemented ioctl 0x%x\n", tape->name, cmd); > > > + unlock_kernel(); > > > return -EINVAL; > > Surely a bu

Re: [PATCH] Change paride driver to use unlocked_ioctl instead of ioctl

2008-01-09 Thread Jiri Kosina
On Wed, 9 Jan 2008, Matthew Wilcox wrote: > > default: > > printk("%s: Unimplemented ioctl 0x%x\n", tape->name, cmd); > > + unlock_kernel(); > > return -EINVAL; > Surely a bug ... shouldn't this return -ENOTTY? What POSIX states [1]: [EINVAL] The request

Re: [PATCH] Change paride driver to use unlocked_ioctl instead of ioctl

2008-01-09 Thread Matthew Wilcox
On Thu, Jan 10, 2008 at 12:53:04PM +0530, Nikanth Karthikesan wrote: > default: > printk("%s: Unimplemented ioctl 0x%x\n", tape->name, cmd); > + unlock_kernel(); > return -EINVAL; Surely a bug ... shouldn't this return -ENOTTY? -- Intel are signing m

Re: [PATCH] Change paride driver to use unlocked_ioctl instead of ioctl

2008-01-09 Thread Christoph Hellwig
On Wed, Jan 09, 2008 at 01:14:25PM +0100, Jan Engelhardt wrote: > I wonder why a simple copy_from_user() requires the BKL.. if pt > does need locking, then probably some mutex inside pt. Given this is a janitorial project where the people don't even have the hardware to test it's best to do a 1:1

Re: [PATCH] Change paride driver to use unlocked_ioctl instead of ioctl

2008-01-09 Thread Jan Engelhardt
On Jan 10 2008 14:25, Nikanth Karthikesan wrote: >-static int pt_ioctl(struct inode *inode, struct file *file, >- unsigned int cmd, unsigned long arg) >+static long pt_ioctl(struct file *file, unsigned int cmd, >+ unsigned long arg) > { > struct pt_unit *tape = file->priva

Re: [PATCH] Change paride driver to use unlocked_ioctl instead of ioctl

2008-01-09 Thread Nikanth Karthikesan
On Wed, 2008-01-09 at 03:23 -0500, [EMAIL PROTECTED] wrote: > On Wed, 09 Jan 2008 08:06:20 GMT, Christoph Hellwig said: > > > It's generally considered good style to only have as few as possible > > return values. And this is especially important when returning from > > a section that's under a l

Re: [PATCH] Change paride driver to use unlocked_ioctl instead of ioctl

2008-01-09 Thread Valdis . Kletnieks
On Wed, 09 Jan 2008 08:06:20 GMT, Christoph Hellwig said: > It's generally considered good style to only have as few as possible > return values. And this is especially important when returning from > a section that's under a lock. So in this case it would be much better > if you changes this fu

Re: [PATCH] Change paride driver to use unlocked_ioctl instead of ioctl

2008-01-09 Thread Christoph Hellwig
On Thu, Jan 10, 2008 at 11:44:20AM +0530, Nikanth Karthikesan wrote: > -static int pt_ioctl(struct inode *inode, struct file *file, > - unsigned int cmd, unsigned long arg) > +static long pt_ioctl(struct file *file, unsigned int cmd, unsigned long > arg) this looks line-wrapper by your mailer

Re: [PATCH] Change paride driver to use unlocked_ioctl instead of ioctl

2008-01-08 Thread Nikanth Karthikesan
Sorry missed the function prototype and includes earlier. Here is the corrected patch. Build tested. The ioctl handler is called with the BKL held. Registering unlocked_ioctl handler instead of registering ioctl handler. Signed-off-by: Nikanth Karthikesan <[EMAIL PROTECTED]> --- diff --git a/dr

[PATCH] Change paride driver to use unlocked_ioctl instead of ioctl

2008-01-08 Thread Nikanth Karthikesan
The ioctl handler is called with the BKL held. Registering unlocked_ioctl handler instead of registering ioctl handler. Signed-off-by: Nikanth Karthikesan <[EMAIL PROTECTED]> --- diff --git a/arch/x86/kernel/cpu/mcheck/mce_64.c b/arch/x86/kernel/cpu/mcheck/mce_64.c diff --git a/drivers/block/pa