mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Alasdair G Kergon <agk@redhat.com>
Cc: mbroz@redhat.com, linux-kernel@vger.kernel.org,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH 01/15] dm: support ioctls on mapped devices
Date: Thu, 22 Jun 2006 09:55:51 -0700	[thread overview]
Message-ID: <20060622095551.b5c6ddce.akpm@osdl.org> (raw)
In-Reply-To: <20060622151721.GT19222@agk.surrey.redhat.com>

On Thu, 22 Jun 2006 16:17:21 +0100
Alasdair G Kergon <agk@redhat.com> wrote:

> On Thu, Jun 22, 2006 at 01:29:57AM -0700, Andrew Morton wrote:
> > OK.  I do think dm needs to remember /dev/sda's file* to get this right
> > though.  That's where the ->ioctl methods are.
> 
> > Oh dear.  raw_open() doesn't have a file* for the device.
>  
> Similar with device-mapper: in normal usage dm only sees major:minor.
> 
> Yes, the filp dm passes along is incorrect:
> 
> - return blkdev_driver_ioctl(bdev->bd_inode, filp, bdev->bd_disk, cmd, arg);
> + return blkdev_driver_ioctl(bdev->bd_inode, NULL, bdev->bd_disk, cmd, arg);
> 
> But should unlocked_ioctl become ?
> 
> - long (*unlocked_ioctl) (struct file *, unsigned, unsigned long);
> + long (*unlocked_ioctl) (struct inode *, struct file *, unsigned, unsigned long);
> 
> so it can be used for block devices?

Perhaps it should (have).  It's a bit nasty, but we do have at least two
internal callers who don't have a file*.

The alternative would be to cook up a fake file* like blkdev_get() does,
but we don't want to propagate that practice.

Oh well.  I suppose a lock_kernel() won't kill us.

> See also block/scsi_ioctl.c:201 verify_command()  [scsi_cmd_ioctl]
>          * file can be NULL from ioctl_by_bdev()...
> 
> Or should we be working towards eliminating interfaces that use device numbers?

If possible.  I guess that would require DM to track the devices with
file*'s or inode*'s or bdev*'s.  Which, I assume, would be non-trivial.

  reply	other threads:[~2006-06-22 16:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-21 19:31 Alasdair G Kergon
2006-06-22  3:52 ` Andrew Morton
2006-06-22  8:15   ` Milan Broz
2006-06-22  8:29     ` Andrew Morton
2006-06-22 15:17       ` Alasdair G Kergon
2006-06-22 16:55         ` Andrew Morton [this message]
2006-06-23  3:31           ` Kevin Corry
2006-06-23  3:49             ` Andrew Morton
2006-06-23 10:01               ` Christoph Hellwig
2006-06-23 10:00           ` Christoph Hellwig
     [not found]             ` <20060623032108.28debec2.akpm@osdl.org>
2006-06-23 13:13               ` Milan Broz
2006-06-22 13:21   ` Alasdair G Kergon
2006-07-05  3:22 ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060622095551.b5c6ddce.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=agk@redhat.com \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbroz@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome