2007-10-06 18:28:46

by Arnd Bergmann

[permalink] [raw]
Subject: [patch 8/9] compat_ioctl: call disk->fops->compat_ioctl without BKL

Normally, all compat_ioctl operations are called without the BKL, the
block device operations are an exception to this rule.

Make this work the same as the other handlers.

Signed-off-by: Arnd Bergmann <[email protected]>

---
It would be good to find out whether it has been using the BKL
on purpose or by accident, before this patch gets applied.


Index: linux-2.6/block/compat_ioctl.c
===================================================================
--- linux-2.6.orig/block/compat_ioctl.c
+++ linux-2.6/block/compat_ioctl.c
@@ -804,10 +804,10 @@ long compat_blkdev_ioctl(struct file *fi

lock_kernel();
ret = compat_blkdev_locked_ioctl(inode, file, bdev, cmd, arg);
- /* FIXME: why do we assume -> compat_ioctl needs the BKL? */
+ unlock_kernel();
+
if (ret == -ENOIOCTLCMD && disk->fops->compat_ioctl)
ret = disk->fops->compat_ioctl(file, cmd, arg);
- unlock_kernel();

if (ret != -ENOIOCTLCMD)
return ret;

--


2007-10-07 09:53:58

by Al Viro

[permalink] [raw]
Subject: Re: [patch 8/9] compat_ioctl: call disk->fops->compat_ioctl without BKL

On Sat, Oct 06, 2007 at 08:19:10PM +0200, Arnd Bergmann wrote:
> Normally, all compat_ioctl operations are called without the BKL, the
> block device operations are an exception to this rule.
>
> Make this work the same as the other handlers.
>
> Signed-off-by: Arnd Bergmann <[email protected]>
>
> ---
> It would be good to find out whether it has been using the BKL
> on purpose or by accident, before this patch gets applied.

Leave it alone, for now - I'm rebasing my series on top of your 1--7
and it will both makes ->ioctl() and ->compat_ioctl() called unlocked
and switches ->compat_ioctl() to passing bdev instead of struct file
(->unlocked_ioctl() simply dies).

2007-10-07 11:03:56

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [patch 8/9] compat_ioctl: call disk->fops->compat_ioctl without BKL

On Sunday 07 October 2007, Al Viro wrote:
> On Sat, Oct 06, 2007 at 08:19:10PM +0200, Arnd Bergmann wrote:

> > It would be good to find out whether it has been using the BKL
> > on purpose or by accident, before this patch gets applied.
>
> Leave it alone, for now - I'm rebasing my series on top of your 1--7
> and it will both makes ->ioctl() and ->compat_ioctl() called unlocked
> and switches ->compat_ioctl() to passing bdev instead of struct file
> (->unlocked_ioctl() simply dies).

ok, excellent.

Arnd <><