Re: [PATCH] dm: support ioctls on mapped devices: fix with fake file

From: Alasdair G Kergon
Date: Fri Jun 23 2006 - 15:12:21 EST


On Fri, Jun 23, 2006 at 07:45:20PM +0100, Christoph Hellwig wrote:
> NACK. You should use ioctl_by_bdev and fix it to fake up the file pointer
> instead. That keeps faking the file pointer in a single place and solves
> the problem of NULL file pointers for other cases like the s390 partitioning
> code, or various odd filesystems figuring out partition tables by themselves.
> For bonus points use a common helper for both blkdev_get and ioctl_by_bdev
> that creates the fake struct file.

Fixing the existing callers that pass a NULL file struct is a separate matter
that can be handled by a later patch, as can consolidating all the fake users.

I don't follow the reasoning behind backing out and using ioctl_by_bdev() here.
Isn't the primary reason for its existence to add a set_fs(KERNEL_DS) to the
mix? I don't understand why device-mapper should interfere (surely
incorrectly?) at that level.

Alasdair
--
agk@xxxxxxxxxx
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/