linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	David Miller <davem@davemloft.net>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Network Development <netdev@vger.kernel.org>,
	David Howells <dhowells@redhat.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [Bug 106241] New: shutdown(3)/close(3) behaviour is incorrect for sockets in accept(3)
Date: Sat, 31 Oct 2015 21:51:16 +0000	[thread overview]
Message-ID: <20151031215116.GO22011@ZenIV.linux.org.uk> (raw)
In-Reply-To: <CA+55aFz9wm7LssaaUzmo-NYNGW88gb_TkUFSJoFJrY+fvtt8+A@mail.gmail.com>

On Sat, Oct 31, 2015 at 02:23:31PM -0700, Linus Torvalds wrote:

> The other stuff we probably can't do all that much about. Unless we
> decide to go for some complicated lockless optimistic file descriptor
> allocation scheme with retry-on-failure instead of locks. Which I'm
> sure is possible, but I'm equally sure is painful.

The interesting part is dup2() - we'd have to do something like
	serialize against other dup2
	was_claimed = atomically set and test bit in bitmap
	if was_claimed
		tofree = fdt->fd[fd];
		if (!tofree)
			fail with EBUSY
	install into ->fd[...]
	end of critical area
in there; __alloc_fd() could be made retry-on-failure, but I don't see
how to cope with dup2 vs. dup2 without an explicit exclusion.

  reply	other threads:[~2015-10-31 21:51 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201510221824.t9MIOp6n003978@room101.nl.oracle.com>
     [not found] ` <20151022190701.GV22011@ZenIV.linux.org.uk>
     [not found]   ` <201510221951.t9MJp5LC005892@room101.nl.oracle.com>
     [not found]     ` <20151022215741.GW22011@ZenIV.linux.org.uk>
     [not found]       ` <201510230952.t9N9qYZJ021998@room101.nl.oracle.com>
     [not found]         ` <20151024023054.GZ22011@ZenIV.linux.org.uk>
     [not found]           ` <201510270908.t9R9873a001683@room101.nl.oracle.com>
     [not found]             ` <562F577E.6000901@oracle.com>
     [not found]               ` <20151027231702.GA22011@ZenIV.linux.org.uk>
     [not found]                 ` <1445991236.7476.59.camel@edumazet-glaptop2.roam.corp.google.com>
2015-10-28 12:35                   ` [Bug 106241] New: shutdown(3)/close(3) behaviour is incorrect for sockets in accept(3) Al Viro
2015-10-28 13:24                     ` Eric Dumazet
2015-10-28 14:47                       ` Eric Dumazet
2015-10-28 21:13                         ` Al Viro
2015-10-28 21:44                           ` Eric Dumazet
2015-10-28 22:33                             ` Al Viro
2015-10-28 23:08                               ` Eric Dumazet
2015-10-29  0:15                                 ` Al Viro
2015-10-29  3:29                                   ` Eric Dumazet
2015-10-29  4:16                                     ` Al Viro
2015-10-29 12:35                                       ` Eric Dumazet
2015-10-29 13:48                                         ` Eric Dumazet
2015-10-30 17:18                                         ` Linus Torvalds
2015-10-30 21:02                                           ` Al Viro
2015-10-30 21:23                                             ` Linus Torvalds
2015-10-30 21:50                                               ` Linus Torvalds
2015-10-30 22:33                                                 ` Al Viro
2015-10-30 23:52                                                   ` Linus Torvalds
2015-10-31  0:09                                                     ` Al Viro
2015-10-31 15:59                                                     ` Eric Dumazet
2015-10-31 19:34                                                     ` Al Viro
2015-10-31 19:54                                                       ` Linus Torvalds
2015-10-31 20:29                                                         ` Al Viro
2015-11-02  0:24                                                           ` Al Viro
2015-11-02  0:59                                                             ` Linus Torvalds
2015-11-02  2:14                                                             ` Eric Dumazet
2015-11-02  6:22                                                               ` Al Viro
2015-10-31 20:45                                                         ` Eric Dumazet
2015-10-31 21:23                                                           ` Linus Torvalds
2015-10-31 21:51                                                             ` Al Viro [this message]
2015-10-31 22:34                                                             ` Eric Dumazet
2015-10-31  1:07                                                 ` Eric Dumazet

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=20151031215116.GO22011@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --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;
as well as URLs for NNTP newsgroup(s).