qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Hani Benhabiles <kroosec@gmail.com>
Cc: kwolf@redhat.com, famz@redhat.com, qemu-devel@nongnu.org,
	stefanha@redhat.com, mreitz@redhat.com
Subject: Re: [Qemu-devel] [PATCH 3/3] nbd: Shutdown socket before closing.
Date: Thu, 05 Jun 2014 03:55:40 +0200	[thread overview]
Message-ID: <538FCE1C.5000708@redhat.com> (raw)
In-Reply-To: <20140604222806.GA7620@Inspiron-3521>

Il 05/06/2014 00:33, Hani Benhabiles ha scritto:
> > IIUC, what this does is ensure that the other side gets a FIN before it gets
> > a RST.  Is this correct?
>
> Yes. Without shutdown(), this could be reproduced (unreliably) on multiple
> tries. This is done in nbd_client_close() too, for the same reasons AFAICT.

Actually, nbd_client_close() is different because it's an abortive close 
of the socket.  nbd_client_close() doesn't care about FIN vs. RST, it 
does the shutdown to force all the requests to fail (with either an 
error for writes, or a short read if they're receiving).  This will 
cause a flurry of nbd_client_put() calls soon after nbd_clint_close() 
returns, until the last reference is dropped and the socket is closed.

I'll apply the patch.

Paolo

  reply	other threads:[~2014-06-05  1:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1401572382-11667-1-git-send-email-kroosec@gmail.com>
     [not found] ` <1401572382-11667-2-git-send-email-kroosec@gmail.com>
2014-06-02 12:32   ` [Qemu-devel] [PATCH 1/3] nbd: Handle fixed new-style clients Stefan Hajnoczi
2014-06-02 22:09     ` Hani Benhabiles
2014-06-04  8:01       ` Stefan Hajnoczi
     [not found] ` <1401572382-11667-4-git-send-email-kroosec@gmail.com>
2014-06-03 11:33   ` [Qemu-devel] [PATCH 3/3] nbd: Shutdown socket before closing Paolo Bonzini
2014-06-04 22:33     ` Hani Benhabiles
2014-06-05  1:55       ` Paolo Bonzini [this message]
2014-06-05  9:58         ` Hani Benhabiles
2014-06-05 10:31           ` Paolo Bonzini
     [not found] ` <1401572382-11667-3-git-send-email-kroosec@gmail.com>
2014-06-03 11:36   ` [Qemu-devel] [PATCH 2/3] nbd: Add exports listing support Paolo Bonzini
2014-06-04 22:35     ` Hani Benhabiles

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=538FCE1C.5000708@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=famz@redhat.com \
    --cc=kroosec@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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;
as well as URLs for NNTP newsgroup(s).