public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ulrich Drepper <drepper@redhat.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Davide Libenzi <davidel@xmailserver.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>, Eric Dumazet <dada1@cosmosbay.com>
Subject: Re: [patch 7/8] fdmap v2 - implement sys_socket2
Date: Thu, 07 Jun 2007 07:25:31 -0700	[thread overview]
Message-ID: <4668155B.4020705@redhat.com> (raw)
In-Reply-To: <20070607110432.73be7960@the-village.bc.nu>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alan Cox wrote:
>> continuous allocation are part of the API.  It's required by POSIX and
>> provided by Unix since the early days.  There are entire code bases out
>> there which depend on this assumption.  Linking with code like this,
>> before or after the new version controlled symbol is introduced, will
>> break it. 
> 
> If your linker is doing its job then you won't be able to link them
> together because they have incompatible assumptions. Not exactly rocket
> science even if it is done a little differently to the usual symbol
> compatibility tests. 

No.  You still don't appreciate the problem.

Assume I would change code so that newly compiled programs which use
open, socket, etc generate different references which cannot be
satisfied by old runtimes.  That and only that is something linkers can
see, linkers deal with symbols and references.

If I would do that and people would recompile their existing code this
*still* does not change the fact that the program behavior would be
changed and the code might break.  It can be something as simple as

   int fd = open(...);
   ...
   close(fd);
   ...
   close(STDIN_FILENO);
   open(...);

The last open is supposed to open a new file with descriptor 0 (i.e.,
STDIN_FILENO).  By using non-sequential descriptors this is not guaranteed.

This is nothing you can change with linker magic.  It is embedded in the
code.  It's behavior *guaranteed* by POSIX and Unix before it for
decades.  This isn't anything you can change.


> And the stuff you are trying to put into the kernel is better ? No, its a
> bunch of ugly hacks caused by trying to solve the problem in the wrong
> way and in the wrong place.

Go back 30 years and convince people to not guarantee first-match
allocation of descriptors.  Then you can stand up and demand purity.
But just as in many other cases, legacy demands its price.  We sometimes
have to pay the price for compatibility and if it isn't high it's worth
it.  I don't say the current proposed code is the answer but iff
Davide's unified code does not perform worse than the current code I
don't see the harm since, for instance, extending socket() is in any
case necessary.  I mentioned that close_on_exit must be set on open,
else leaks are risked.  This will come naturally with a flags parameter
which already takes O_NONSEQFD.

- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFGaBVb2ijCOnn/RHQRAnzGAJwLY3dDc9nl69yFPZfYUr8qbIeXygCfTqMd
u5Jofy3gFB5bWEHdnPtUhJY=
=Jz/g
-----END PGP SIGNATURE-----

  parent reply	other threads:[~2007-06-07 17:25 UTC|newest]

Thread overview: 129+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-06 22:30 [patch 7/8] fdmap v2 - implement sys_socket2 Davide Libenzi
2007-06-06 22:44 ` David Miller
2007-06-06 22:52   ` Davide Libenzi
2007-06-06 22:57     ` David Miller
2007-06-06 22:57   ` Ulrich Drepper
2007-06-06 23:02     ` David Miller
2007-06-06 22:59 ` Alan Cox
2007-06-06 22:58   ` Ulrich Drepper
2007-06-06 23:04   ` Davide Libenzi
2007-06-06 23:08     ` David Miller
2007-06-06 23:19     ` Alan Cox
2007-06-06 23:22       ` Ulrich Drepper
2007-06-07 10:04         ` Alan Cox
2007-06-07 11:59           ` Kyle Moffett
2007-06-07 13:12             ` Eric Dumazet
2007-06-07 15:51               ` Davide Libenzi
2007-06-07 19:49               ` Davide Libenzi
2007-06-07 20:02                 ` Ulrich Drepper
2007-06-07 20:05                 ` Eric Dumazet
2007-06-07 20:18                   ` Ulrich Drepper
2007-06-07 21:44                     ` Davide Libenzi
2007-06-07 22:03                       ` Ulrich Drepper
2007-06-07 22:40                         ` Davide Libenzi
2007-06-08 12:07                           ` Theodore Tso
2007-06-08 13:01                             ` Alan Cox
2007-06-08 18:11                               ` Davide Libenzi
2007-06-08 18:26                                 ` Alan Cox
2007-06-08 18:43                                   ` Ulrich Drepper
2007-06-08 18:46                                     ` Al Viro
2007-06-08 18:56                                       ` Ulrich Drepper
2007-06-08 19:07                                         ` Linus Torvalds
2007-06-08 19:21                                           ` Davide Libenzi
2007-06-09  0:03                                             ` Linus Torvalds
2007-06-09  0:13                                               ` Davide Libenzi
2007-06-09  0:36                                               ` Al Viro
2007-06-09  1:19                                                 ` Ulrich Drepper
2007-06-09  1:41                                                   ` Al Viro
2007-06-09  2:10                                                     ` Ulrich Drepper
2007-06-09 15:15                                                       ` Al Viro
2007-06-09 16:26                                                         ` Ulrich Drepper
2007-06-09 16:54                                                           ` Al Viro
2007-06-09 17:04                                                             ` Davide Libenzi
2007-06-09 17:08                                                               ` Davide Libenzi
2007-06-09 17:08                                                             ` Ulrich Drepper
2007-06-09 17:24                                                               ` Al Viro
2007-06-09 19:27                                                                 ` Kyle Moffett
2007-06-09 20:06                                                                   ` Al Viro
2007-06-09 20:21                                                                     ` Linus Torvalds
2007-06-09 20:31                                                                       ` Davide Libenzi
2007-06-09 21:41                                                                         ` Matt Mackall
2007-06-09 22:12                                                                           ` Davide Libenzi
2007-06-09 20:49                                                                       ` Al Viro
2007-06-09 21:55                                                                         ` Matt Mackall
2007-06-09 23:33                                                                         ` Linus Torvalds
2007-06-10  3:35                                                                           ` Davide Libenzi
2007-06-10  3:49                                                                             ` Davide Libenzi
2007-06-10  3:19                                                                       ` Al Viro
2007-06-10  3:48                                                                         ` Linus Torvalds
2007-06-10  4:00                                                                           ` Al Viro
2007-06-10  4:03                                                                             ` Linus Torvalds
2007-06-10  4:06                                                                               ` Al Viro
2007-06-10  4:45                                                                           ` dean gaudet
2007-06-10  5:06                                                                             ` Linus Torvalds
2007-06-10  5:46                                                                               ` Al Viro
2007-06-10 17:23                                                                                 ` Linus Torvalds
2007-06-10  6:35                                                                           ` Kari Hurtta
2007-06-10 15:21                                                                             ` Alan Cox
2007-06-10  9:14                                                                       ` Eric Dumazet
2007-06-10 15:16                                                                         ` Alan Cox
2007-06-10 18:19                                                                         ` Linus Torvalds
2007-06-10  2:40                                                                   ` Al Viro
2007-06-08 19:34                                         ` Alan Cox
2007-06-08 19:30                                     ` Alan Cox
2007-06-08 19:37                                       ` Davide Libenzi
2007-06-08 19:48                                         ` Alan Cox
2007-06-08 19:51                                           ` Davide Libenzi
2007-06-08 21:24                                             ` Alan Cox
2007-06-08 21:59                                               ` Davide Libenzi
2007-06-08 22:28                                                 ` Alan Cox
2007-06-08 22:38                                                   ` Davide Libenzi
2007-06-11  8:24                                       ` Xavier Bestel
2007-06-08 19:22                                   ` Davide Libenzi
2007-06-09  5:41                                 ` Paul Mackerras
2007-06-09 14:38                                   ` Kyle Moffett
2007-06-10  6:48                                     ` Paul Mackerras
2007-06-10 15:56                                       ` Davide Libenzi
2007-06-10 19:16                                       ` Davide Libenzi
2007-06-09 17:00                                   ` Davide Libenzi
2007-06-10  6:26                                     ` Paul Mackerras
2007-06-10  7:10                                       ` William Lee Irwin III
2007-06-10 15:52                                       ` Davide Libenzi
2007-06-08 18:07                             ` Davide Libenzi
2007-06-08 18:35                             ` Linus Torvalds
2007-06-07 21:57                   ` Davide Libenzi
2007-06-08  4:38                     ` Eric Dumazet
2007-06-08  5:20                       ` Davide Libenzi
2007-06-07 14:25           ` Ulrich Drepper [this message]
2007-06-07 17:56             ` Eric Dumazet
2007-06-07 18:03               ` Davide Libenzi
2007-06-07 18:57                 ` Eric Dumazet
2007-06-07 18:26               ` Ulrich Drepper
2007-06-07 18:39                 ` Davide Libenzi
2007-06-07 18:56                   ` Ulrich Drepper
2007-06-07 19:12                     ` Davide Libenzi
2007-06-07 20:03                   ` Andrew Morton
2007-06-08  2:55                     ` Ulrich Drepper
2007-06-08  5:16                       ` Davide Libenzi
2007-06-06 23:29       ` Davide Libenzi
2007-06-07 10:06         ` Alan Cox
2007-06-07 10:45           ` Eric Dumazet
2007-06-07 11:27             ` Alan Cox
2007-06-07 15:41           ` Davide Libenzi
2007-06-07 20:10   ` Linus Torvalds
2007-06-07 20:47     ` Eric Dumazet
2007-06-07 21:08       ` Linus Torvalds
2007-06-07 21:41         ` Davide Libenzi
2007-06-07 20:59     ` Guillaume Chazarain
2007-06-07 21:06       ` Guillaume Chazarain
2007-06-07 21:31     ` Ulrich Drepper
2007-06-07 22:22     ` Davide Libenzi
2007-06-07 23:42       ` Linus Torvalds
2007-06-08  0:04         ` Davide Libenzi
2007-06-08  0:59     ` Matt Mackall
2007-06-08  2:25       ` Linus Torvalds
2007-06-08 15:56     ` Jeff Dike
2007-06-07  0:29 ` Arnd Bergmann
2007-06-07  0:33   ` Davide Libenzi
  -- strict thread matches above, loose matches on Subject: below --
2007-06-06 22:30 [patch 1/8] fdmap v2 - fdmap core Davide Libenzi
2007-06-07  6:54 ` Eric Dumazet
2007-06-07  7:10   ` Davide Libenzi
2007-06-07 10:39     ` [patch 7/8] fdmap v2 - implement sys_socket2 Eric Dumazet
2007-06-07 15:42       ` Davide Libenzi

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=4668155B.4020705@redhat.com \
    --to=drepper@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=dada1@cosmosbay.com \
    --cc=davidel@xmailserver.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@linux-foundation.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