Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp356536ybb; Fri, 3 Apr 2020 04:09:33 -0700 (PDT) X-Google-Smtp-Source: APiQypI4NGQrkdKhIaTtr80xslijWutCksVDPQdjwiAVHJs4okp/Fn44Yl9xSxuyO9MioFCasX3V X-Received: by 2002:a05:6830:1d95:: with SMTP id y21mr6103746oti.180.1585912173019; Fri, 03 Apr 2020 04:09:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585912173; cv=none; d=google.com; s=arc-20160816; b=EPve+6MrtYDdZXjFcOEcx/5xR/YMVdtQrODWGhqdNrKQzKzFY04eTbBEotDvBS4zsN 9tNA+yVA8c7HDShoEP42I47GPbOmY0BRH3QiFSYCz665+yknZxeqWFBBajlu/DeX38BQ Pm1lS9tOMQck7vQDzE5Oukw+UUjMrMWME8TH7qpdW4k7wgKX6TxomKZWY4/zMPhq3YP1 fGMRsOZgD8hknEGiswR6qfzScAUBRTmrVnYrcBS/9/8cFweNosFcbgYKjynUzcn/oAUd MpB5/Bch6VLXKIYQ77rw5mSHPfHWjW+ZvjtfmPa0nixnsuMdt9FsMjO5SthCa3mlddcc luUQ== 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=gloONvhWrsH3eGggjCx0ZX0IwNzQyZGCYxeBaZ61Tw8=; b=ME4jj9SG82e7bw169M9hccPvrZN+Jnvf4XSWgG7CjZkh9rGL+r6H6s5TCQIeiZFWqU rRlBewHke2jkYYWceQ5JfMm7g5xpP5cW/zEEhmxM7bQVMiTVZxifQ0Kl5OW839PYIhhX pVdy2TSVvFr1kJTf1bOa3r5ceyeoDl2QxtoWCWqVEPcbcBI2yqdEcSXQILp6Qwjp+CVn y5RPaUcjhxlcX79vS1xFgnBADMW9imy9xqpuBnWlVKoDGDZqcz9z3FVIkFCYUCFIqCgw GW7kSWw6/kgPe7RYrz+rY/D7BCFd8uA1HE50qijSvm/dUtUyXOnyzeNhDOGw9W0DJHKq iSXA== 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 79si3665690oty.232.2020.04.03.04.09.18; Fri, 03 Apr 2020 04:09:33 -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 S2390474AbgDCLIp (ORCPT + 99 others); Fri, 3 Apr 2020 07:08:45 -0400 Received: from gardel.0pointer.net ([85.214.157.71]:51808 "EHLO gardel.0pointer.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727911AbgDCLIp (ORCPT ); Fri, 3 Apr 2020 07:08:45 -0400 Received: from gardel-login.0pointer.net (gardel.0pointer.net [85.214.157.71]) by gardel.0pointer.net (Postfix) with ESMTP id 5B38AE80689; Fri, 3 Apr 2020 13:08:43 +0200 (CEST) Received: by gardel-login.0pointer.net (Postfix, from userid 1000) id 5120A1614E3; Fri, 3 Apr 2020 13:08:42 +0200 (CEST) Date: Fri, 3 Apr 2020 13:08:42 +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: <20200403110842.GA34663@gardel-login> References: <2590640.1585757211@warthog.procyon.org.uk> <36e45eae8ad78f7b8889d9d03b8846e78d735d28.camel@themaw.net> <20200402143623.GB31529@gardel-login> <20200402152831.GA31612@gardel-login> <20200402155020.GA31715@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 Do, 02.04.20 19:20, Miklos Szeredi (miklos@szeredi.hu) wrote: > On Thu, Apr 2, 2020 at 5:50 PM Lennart Poettering wrote: > > > > On Do, 02.04.20 17:35, Miklos Szeredi (miklos@szeredi.hu) wrote: > > > > > > systemd cares about all mount points in PID1's mount namespace. > > > > > > > > The fact that mount tables can grow large is why we want something > > > > better than constantly reparsing the whole /proc/self/mountinfo. But > > > > filtering subsets of that is something we don't really care about. > > > > > > I can accept that, but you haven't given a reason why that's so. > > > > > > What does it do with the fact that an automount point was crossed, for > > > example? How does that affect the operation of systemd? > > > > We don't care how a mount point came to be. If it's autofs or > > something else, we don't care. We don't access these mount points > > ourselves ever, we just watch their existance. > > > > I mean, it's not just about startup it's also about shutdown. At > > shutdown we need to unmount everything from the leaves towards the > > root so that all file systems are in a clean state. > > Unfortunately that's not guaranteed by umounting all filesystems from > the init namespace. A filesystem is shut down when all references to > it are gone. Perhaps you instead want to lazy unmount root (yeah, > that may not actually be allowed, but anyway, lazy unmounting the top > level ones should do) and watch for super block shutdown events > instead. > > 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, … Because the initrd is its own little root fs independent of the actual root we can fully disassemble everything this way, as we do not retain any references to it anymore in any way. Lennart -- Lennart Poettering, Berlin