From: Arnd Bergmann <arnd@arndb.de>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: Andi Kleen <andi@firstfloor.org>,
Linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: compat ioctl32 for /dev/snapshot?
Date: Tue, 5 May 2009 12:58:04 +0200 [thread overview]
Message-ID: <200905051258.05102.arnd@arndb.de> (raw)
In-Reply-To: <49FF6B94.2080008@msgid.tls.msk.ru>
On Tuesday 05 May 2009, Michael Tokarev wrote:
> Arnd Bergmann wrote:
> > On Monday 04 May 2009, Michael Tokarev wrote:
> >> Is the following patch ok? I just pulled all the SNAPSHOT_* stuff from
> >> include/linux/suspend_ioctls.h and added them into fs/compat_ioctl.c.
> []
>
> > You are however missing support for deprecated ioctls in your
> > code: SNAPSHOT_SET_SWAP_FILE and SNAPSHOT_PMOPS are trivial
> > (COMPATIBLE_IOCTL), but you also need to add support for
> > these
>
> Well, as comments in that file (kernel/power/user.c) states, those
> ioctls are obsolete and will be removed and are only preserved for
> compatibility etc. Since no one complained so far (well, no one
> complained about whole /dev/snapshot thing at all ;), maybe there's
> no need to define those and the following ones too?
>
> > #define SNAPSHOT_ATOMIC_SNAPSHOT32 _IOW(SNAPSHOT_IOC_MAGIC, 3, compat_uptr_t)
> > #define SNAPSHOT_SET_IMAGE_SIZE32 _IOW(SNAPSHOT_IOC_MAGIC, 6, compat_ulong)
> > #define SNAPSHOT_AVAIL_SWAP32 _IOR(SNAPSHOT_IOC_MAGIC, 7, compat_uptr_t)
> > #define SNAPSHOT_GET_SWAP_PAGE32 _IOR(SNAPSHOT_IOC_MAGIC, 8, compat_uptr_t)
The point is that they are meant for compatibility with existing binaries,
which is also the reason for having the compat_ioctl in the first place.
The kernel should behave in identical ways for both 32 and 64 bits, so
either we add all of the ioctl numbers in compat mode, or we remove support
for the obsolete calls in native mode as well.
> > Please try this patch instead:
>
> Ok. Your patch was garbled by your MUA (inserting =3D =20 and breaking
> lines), but that's ok.
sorry about that, I'll try to find out how that happened.
> After de-garbling it now complains about
> undefined compat_uptr_t. For that, I've added
>
> #ifdef CONFIG_COMPAT
> #include <linux/compat.h>
> #endif
This one does not need to be enclosed in #ifdef CONFIG_COMPAT,
the file can always be included. The reason for the #ifdef inside
of the switch() statement is that you otherwise get warnings
about duplicate case statements on 32 bit kernels.
Arnd <><
next prev parent reply other threads:[~2009-05-05 10:58 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-04 9:29 compat ioctl32 for /dev/snapshot? Michael Tokarev
2009-05-04 9:35 ` Andi Kleen
2009-05-04 10:55 ` Michael Tokarev
2009-05-04 11:12 ` Andi Kleen
2009-05-04 21:55 ` Rafael J. Wysocki
2009-05-05 11:38 ` Arnd Bergmann
2009-05-05 11:43 ` Michael Tokarev
2009-05-05 23:13 ` Rafael J. Wysocki
2009-05-04 11:52 ` Arnd Bergmann
2009-05-04 22:26 ` Michael Tokarev
2009-05-05 10:58 ` Arnd Bergmann [this message]
2009-05-04 21:58 ` Rafael J. Wysocki
2009-07-10 16:21 ` Pavel Machek
2009-07-12 0:19 ` Michael Tokarev
2009-07-12 15:07 ` Arnd Bergmann
2009-07-13 6:51 ` Michael Tokarev
2009-07-13 20:21 ` Pavel Machek
2009-07-14 6:57 ` Michael Tokarev
2009-07-14 9:55 ` 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=200905051258.05102.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=andi@firstfloor.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mjt@tls.msk.ru \
/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