Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp615971ybb; Fri, 3 Apr 2020 08:45:40 -0700 (PDT) X-Google-Smtp-Source: APiQypLjSV5ZFeR8a2W3M0JwQi+wUrxlDpk4aczoQRr2wblmNgfc034fjBpk0mxd5gupBU88FiQc X-Received: by 2002:a9d:ecc:: with SMTP id 70mr6623361otj.193.1585928740374; Fri, 03 Apr 2020 08:45:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585928740; cv=none; d=google.com; s=arc-20160816; b=dU+ds212aFIcx/zXiSYOdu7/0FtOEU+YIUXi3aVJkgjbfwbx12Xt2MDBfbwfDjfRJ3 j5M8lfEZQ9OZSMbHNjtledUQ1S+yf2JcHtbw+wkPhfZzzmZrY6eUcfQeCY3pxPXS+gZa AyT0L6UVVhZ/+G+QXfg6+plCS03oGRLjXQZTY6mZT/Poy4WRqsDmYZPSgfKkcSXc6RLN m/yEGwjA+ClteRAhyTy9qCNwxfCPCINJdFsDk4EKW9QwUg9eKHEU24u/MpVwYiz+HCUG 2hg6+7H4V3p8FV7xvIdGIQxOwinGyG2VmdwUG+z3RkUlqe2FU0KTtXQmfmkRAJb62FLG LRSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=LXyquIrWyz1XdxlRb89E4clNQ5o2J3BBq2TK2T8/Z/E=; b=d+hvojNlEwhrsPd22uS62lf0CDNqTc4PijjKD6c3axU5ugviBEzbxHZprkhGZve7a3 3h63WJDG1I83KrOJ1XKwELJ/fx3WnOtWSyh37AoiLrLUGPRc+I6ZrMaaJXfZlIHrVUQm g4sxO9QUtTfSr0fqNw6LnjiJI16XHsl2af2RDD/kIdITxrbPQ9r4Qa7IbAD20UBPuFlp 8zQYPOrIrLx9ouKXp8yBC57jjf+u7VfTYqy6s629B6okcGZzm3pZMb55fMh+MZM5e1X/ gdniNBI7du5+9xVqzWJMWg9MmlzKoLbX6uJ432mK1VGr4TbpB8Ujl7ZtNJFJvOAjVcwD ilnQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l24si4030369otn.57.2020.04.03.08.45.27; Fri, 03 Apr 2020 08:45:40 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404043AbgDCPBp (ORCPT + 99 others); Fri, 3 Apr 2020 11:01:45 -0400 Received: from gardel.0pointer.net ([85.214.157.71]:51982 "EHLO gardel.0pointer.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727431AbgDCPBp (ORCPT ); Fri, 3 Apr 2020 11:01:45 -0400 Received: from gardel-login.0pointer.net (gardel.0pointer.net [85.214.157.71]) by gardel.0pointer.net (Postfix) with ESMTP id 7C208E807B5; Fri, 3 Apr 2020 17:01:43 +0200 (CEST) Received: by gardel-login.0pointer.net (Postfix, from userid 1000) id 1E8C41614E3; Fri, 3 Apr 2020 17:01:43 +0200 (CEST) Date: Fri, 3 Apr 2020 17:01:43 +0200 From: Lennart Poettering To: Miklos Szeredi Cc: Ian Kent , David Howells , Christian Brauner , Linus Torvalds , Al Viro , dray@redhat.com, Karel Zak , Miklos Szeredi , Steven Whitehouse , Jeff Layton , andres@anarazel.de, keyrings@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Aleksa Sarai Subject: Re: Upcoming: Notifications, FS notifications and fsinfo() Message-ID: <20200403150143.GA34800@gardel-login> References: <36e45eae8ad78f7b8889d9d03b8846e78d735d28.camel@themaw.net> <20200402143623.GB31529@gardel-login> <20200402152831.GA31612@gardel-login> <20200402155020.GA31715@gardel-login> <20200403110842.GA34663@gardel-login> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fr, 03.04.20 13:48, Miklos Szeredi (miklos@szeredi.hu) wrote: > > > Does that make any sense? > > > > When all mounts in the init mount namespace are unmounted and all > > remaining processes killed we switch root back to the initrd, so that > > even the root fs can be unmounted, and then we disassemble any backing > > complex storage if there is, i.e. lvm, luks, raid, … > > I think it could be done the other way round, much simpler: > > - switch back to initrd > - umount root, keeping the tree intact (UMOUNT_DETACHED) > - kill all remaining processes, wait for all to exit Nah. What I wrote above is drastically simplified. It's IRL more complex. Specific services need to be killed between certain mounts are unmounted, since they are a backend for another mount. NFS, or FUSE or stuff like that usually has some processes backing them around, and we need to stop the mounts they provide before these services, and then the mounts these services reside on after that, and so on. It's a complex dependency tree of stuff that needs to be done in order, so that we can deal with arbitrarily nested mounts, storage subsystems, and backing services. Anyway, this all works fine in systemd, the dependency logic is there. We want a more efficient way to watch mounts, that's all. Subscribing and constantly reparsing /proc/self/mountinfo is awful, that's all. Lennart -- Lennart Poettering, Berlin