Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4753536ybi; Tue, 28 May 2019 01:52:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqwOfsq/SApmEhOcPsjnHlJTiziQSiLm7AiDBqKI37oJjISATkppN+axythoeoxG/OgmiJjn X-Received: by 2002:a17:902:a50c:: with SMTP id s12mr20696458plq.273.1559033535318; Tue, 28 May 2019 01:52:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559033535; cv=none; d=google.com; s=arc-20160816; b=eceBb8E6JMDrk2Ie27gagPkZ5OeKhF/HAJgVtfNNtdvEWItP0mHUa8fVPPp/KVZWDW 3zIlhEI02dpPYUg7uhh+aoxt5sBrUh8SyV4YnoXWxvUtyBBclLphJpolNss7r3/j1iO8 FqGIoo2OayaZrxRQ/VbLXqK3IYSwPURUOqormjqSetzkt9keZHb9gpcqAHfRzb3Q111G HDVG/M9ARNsvmEIQoRpu5wRzNxDE/j+V9GZ7tewp3Z/U+kl7jNh4jF5iYEIDk0JaVFMZ 7OwL0bVWNOeacIXvFzxcqk7OikvIvOKNagLGWoVLitLktAp8D2LsjDKhcGZ5BeN+7DUf jSDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=pHCQnK4y/qKsp+DDf2a7jZfy16Wl/CNps2H7PaOJE2c=; b=DbGwGuCUsVOpiZN4E1SMoiOj4gtaXPcYV83LLgKEZ9bdAfZODsU7qytkiAGaoUgdj/ n9ao70LwVjH3Ppd7B6M7OmfyWKqc/O08J/2uNu2gDhACT9XeY2ZPwUMHSegCYF+ULaPO 8Z6jyhmgMaKnXbCa27vHSlmnZ9x8k+pjk/hQ868KBzN/Tsq8q4Kljdq8LcJyYkX2kSup dp6BrpRWfBv6/TXFTLurZxGfECDgyAQ+p596WllB0Z5k5jkNbYHKetafyKTbuZ3kBb+2 NK6NCz0JzEbdms4JwgccPnBJQLMeKv1d56/zyd7dDmbhROoc2ZuHW2RNLMunMKM/J8aO p7Sg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ucloud.cn Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g3si25723289pfq.30.2019.05.28.01.51.59; Tue, 28 May 2019 01:52:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ucloud.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726686AbfE1IuH (ORCPT + 99 others); Tue, 28 May 2019 04:50:07 -0400 Received: from m9784.mail.qiye.163.com ([220.181.97.84]:52779 "EHLO m9784.mail.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725943AbfE1IuH (ORCPT ); Tue, 28 May 2019 04:50:07 -0400 Received: from localhost (unknown [120.132.1.243]) by m9784.mail.qiye.163.com (Hmail) with ESMTPA id 4128A41B45; Tue, 28 May 2019 16:50:03 +0800 (CST) Date: Tue, 28 May 2019 02:23:23 +0800 From: Yao Liu To: Josef Bacik Cc: Jens Axboe , linux-block@vger.kernel.org, nbd@other.debian.org, linux-kernel@vger.kernel.org Subject: Re: Re: [PATCH 2/3] nbd: notify userland even if nbd has already disconnected Message-ID: <20190527182323.GB20702@192-168-150-246.7~> References: <1558691036-16281-1-git-send-email-yotta.liu@ucloud.cn> <1558691036-16281-2-git-send-email-yotta.liu@ucloud.cn> <20190524130856.zod5agp7hk74pcnr@MacBook-Pro-91.local.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190524130856.zod5agp7hk74pcnr@MacBook-Pro-91.local.dhcp.thefacebook.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-HM-Spam-Status: e1kIGBQJHllBWUtVQ01DQkJCTExCSUlPSEJNWVdZKFlBSUI3V1ktWUFJV1 kJDhceCFlBWTU0KTY6NyQpLjc#WQY+ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6M0k6Pio4HDg5OiM*SBc3Py4C Qh0wCyxVSlVKTk5CS0hIT0tIT0lJVTMWGhIXVQIUDw8aVRcSDjsOGBcUDh9VGBVFWVdZEgtZQVlK SUtVSkhJVUpVSU9IWVdZCAFZQUlIQk43Bg++ X-HM-Tid: 0a6afda1d7ae2086kuqy4128a41b45 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 24, 2019 at 09:08:58AM -0400, Josef Bacik wrote: > On Fri, May 24, 2019 at 05:43:55PM +0800, Yao Liu wrote: > > Some nbd client implementations have a userland's daemon, so we should > > inform client daemon to clean up and exit. > > > > Signed-off-by: Yao Liu > > Except the nbd_disconnected() check is for the case that the client told us > specifically to disconnect, so we don't want to send the notification to > re-connect because we've already been told we want to tear everything down. > Nack to this as well. Thanks, > > Josef > But in userland, client daemon process and process which send disconnect command are not same process, so they are not clear to each other, so client daemon expect driver inform it to exit. In addition, client daemon will get nbd status with nbd_genl_status interface after it get notified and it should not re-connect if status connected == 0