From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D378FE784AE for ; Mon, 2 Oct 2023 06:22:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235490AbjJBGWH (ORCPT ); Mon, 2 Oct 2023 02:22:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229720AbjJBGWG (ORCPT ); Mon, 2 Oct 2023 02:22:06 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAF639B; Sun, 1 Oct 2023 23:22:03 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 91BE168D07; Mon, 2 Oct 2023 08:21:59 +0200 (CEST) Date: Mon, 2 Oct 2023 08:21:59 +0200 From: Christoph Hellwig To: Wouter Verhelst Cc: Christoph Hellwig , Samuel Holland , Al Viro , Christian Brauner , Jens Axboe , Denis Efremov , Josef Bacik , Stefan Haberland , Jan Hoeppner , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , "Darrick J . Wong" , Chris Mason , David Sterba , linux-block@vger.kernel.org, nbd@other.debian.org, linux-s390@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Shinichiro Kawasaki Subject: Re: [PATCH 07/17] nbd: call blk_mark_disk_dead in nbd_clear_sock_ioctl Message-ID: <20231002062159.GB1140@lst.de> References: <20230811100828.1897174-1-hch@lst.de> <20230811100828.1897174-8-hch@lst.de> <79af9398-167f-440e-a493-390dc4ccbd85@sifive.com> <20230925074838.GA28522@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Sun, Oct 01, 2023 at 07:10:53PM +0200, Wouter Verhelst wrote: > > So what are the semantics of clearing the socket? > > > > The <= 6.5 behavior of invalidating fs caches, but not actually marking > > the fs shutdown is pretty broken, especially if this expects to resurrect > > the device and thus the file system later on. > > nbd-client -d calls > > ioctl(nbd, NBD_DISCONNECT); > ioctl(nbd, NBD_CLEAR_SOCK); > > (error handling removed for clarity) > > where "nbd" is the file handle to the nbd device. This expects that the > device is cleared and that then the device can be reused for a different > connection, much like "losetup -d". Expecting that the next connection > would talk to the same file system is wrong. So a fs shutdown seems like a the right thing. So I'm a little confused on what actualy broke here.