From: Pavel Machek <pavel@ucw.cz>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "David S. Miller" <davem@redhat.com>,
Christoph Hellwig <hch@infradead.org>,
linux-kernel@vger.kernel.org
Subject: Re: ioctl cleanups: enable sg_io and serial stuff to be shared
Date: Fri, 9 May 2003 01:22:26 +0200 [thread overview]
Message-ID: <20030508232226.GA156@elf.ucw.cz> (raw)
In-Reply-To: <200305090048.05081.arnd@arndb.de>
Hi!
> > > BTW, need to extend this to netdev->do_ioctl as well for the
> > > handling of SIOCDEVPRIVATE based stuff. Oh goody, we can finally
> > > fix up that crap :))))
> >
> > There's a *lot* of structs that contain *ioctl:
>
> > atmdev.h: int (*ioctl)(struct atm_dev *dev,unsigned int cmd,void *arg);
> > atmdev.h: int (*ioctl)(struct atm_dev *dev,unsigned int cmd,void *arg);
> > fs.h: int (*ioctl) (struct inode *, struct file *, unsigned, unsigned long);
> > fs.h: int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long);
> > hdlc.h: int (*ioctl)(struct net_device *dev, struct ifreq *ifr, int cmd);
> > ...
>
> There are even some more that your grep did not catch. However, only
> few of them actually need to be changed if we add ->compat_ioctl().
Having few structs with ->ioctl() and few with both ->ioctl() and
->compat_ioctl() seems pretty ugly to me...
> For those subsystems that have a clearly defined set of ioctls that
> are implemented by the specific drivers, the compatibility code can
> be put in a higher level ioctl handler, e.g. atm_ioctl() instead of
> each of the atm drivers.
If it is clearly defined, it should not be an ioctl() in the first
place. Yep, you are right ioctl is probably abused for that at few
points... And finding out where it ->compat_ioctl() is going to be
"interesting".
> Finding out exactly which interfaces need to be extended can be done
> in the process.
> > What about this one: redefine it to (*ioctl)( ...., unsigned *long*,
> > unsinged long). That means we can add
> >
> > #define IOCTL_COMPAT 0x1 0000 0000
>
> I had the same idea before but in addition to the problem that davem
> mentioned, this would require changing every single ioctl handler
> in the kernel and in third party drivers to use 'long' numbers.
Oops; yep, that's a showstopper.
> Not really something we want to do during the current freeze.
>
> The three options that currently make sense to me are:
>
> a) keep using register_ioctl32_conversion() for everything
I believe this makes sense: its too close to 2.6 to do anything else.
> b) add a compat_task() function that handlers may use to decide
> if they should use the compat data structures, list those ioctls
> as COMPATIBLE_IOCTL()
Unfortunately missing compat handler silently does the wrong thing in
this case.
> c) add ->compat_ioctl() to some interfaces, with HANDLE_IOCTL() as
> fallback
Seems like too much rewriting to me...
Pavel
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
next prev parent reply other threads:[~2003-05-08 23:11 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20030507104008$12ba@gated-at.bofh.it>
2003-05-07 11:51 ` ioctl cleanups: enable sg_io and serial stuff to be shared Arnd Bergmann
2003-05-07 12:41 ` Pavel Machek
2003-05-07 12:56 ` Christoph Hellwig
2003-05-07 14:39 ` David S. Miller
2003-05-07 15:12 ` Jeff Garzik
2003-05-07 14:07 ` David S. Miller
2003-05-08 10:46 ` Gerd Knorr
2003-05-08 15:16 ` Ben Collins
2003-05-08 15:51 ` Christoph Hellwig
2003-05-08 15:37 ` Ben Collins
2003-05-08 19:34 ` Pavel Machek
2003-05-08 19:27 ` Ben Collins
2003-05-08 20:06 ` Pavel Machek
2003-05-08 19:47 ` Ben Collins
2003-05-08 20:09 ` David S. Miller
2003-05-08 20:26 ` David Mosberger
2003-05-08 20:33 ` Arjan van de Ven
2003-05-08 21:11 ` David Mosberger
2003-05-08 15:23 ` Arnd Bergmann
2003-05-07 15:28 ` Pavel Machek
2003-05-07 16:04 ` David S. Miller
2003-05-07 19:13 ` Arnd Bergmann
2003-05-07 18:12 ` David S. Miller
2003-05-07 23:50 ` Arnd Bergmann
2003-05-08 10:35 ` David S. Miller
2003-05-07 22:20 ` Alan Cox
2003-05-08 20:33 ` Pavel Machek
2003-05-08 20:43 ` David S. Miller
2003-05-08 23:03 ` Pavel Machek
2003-05-08 23:35 ` Arnd Bergmann
2003-05-08 22:48 ` Arnd Bergmann
2003-05-08 23:22 ` Pavel Machek [this message]
2003-05-07 13:18 ` Arnd Bergmann
2003-05-07 14:01 ` Carl-Daniel Hailfinger
2003-05-07 15:16 ` Pavel Machek
2003-05-07 15:46 ` Arnd Bergmann
2003-05-07 16:07 ` Jens Axboe
2003-05-07 16:20 ` Arnd Bergmann
2003-05-07 10:27 Pavel Machek
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=20030508232226.GA156@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=arnd@arndb.de \
--cc=davem@redhat.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
/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