[PATCH] dm: support ioctls on mapped devices: fix with fake file
authorMilan Broz <mbroz@redhat.com>
Tue, 3 Oct 2006 08:15:22 +0000 (01:15 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 3 Oct 2006 15:04:13 +0000 (08:04 -0700)
commite90dae1f58d475b71bcc4eebf6d4fd5217ed85c7
tree7131716d3889636fce72009f64cd6f65ed7e324c
parent7006f6eca874cd44d37ccb8cfeb8bed04e3bff22
[PATCH] dm: support ioctls on mapped devices: fix with fake file

The new ioctl code passes the wrong file pointer to the underlying device.
No file pointer is available so make a temporary fake one.

ioctl_by_bdev() does set_fs(KERNEL_DS) so it's for ioctls originating
within the kernel and unsuitable here.  We are processing ioctls that
originated in userspace and mapping them to different devices.  Fixing the
existing callers that pass a NULL file struct and consolidating the
fake_file users are separate matters to solve in later patches.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/md/dm-linear.c
drivers/md/dm-mpath.c