Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp391154ybb; Fri, 3 Apr 2020 04:50:40 -0700 (PDT) X-Google-Smtp-Source: APiQypLDo7fbJfBRve1YNrabElFC8YbM/TOOvB+pK6ibKfTfITDw1ni4WBklf1lpHmvwTdntkcD/ X-Received: by 2002:a4a:950b:: with SMTP id m11mr6428844ooi.83.1585914640791; Fri, 03 Apr 2020 04:50:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585914640; cv=none; d=google.com; s=arc-20160816; b=iHCV6X7rlGuXMQp6qJf7cBrC5/iaB9OYd1Xr2tMG82fB0smTEVB0C74HkLqmGR9BfV FuMttOLVew6fUzAybcMDOp/3JIjurJpp7AKx5BQwkWVqfN0i3xD/6CcWfUtHXsP+bO8M lGLwyD6vaO/3CBEgzDt38CiQf3NDwks6UyVUgIdZuiV+WTf+MC+0vmVod1XpQI7KVyy8 wilFH1XH3OlxIDf9Ed//s9mF23nR1XdsZWLuiPrPXZkziw3k1sxqgaph9rOWpflbG1yl 137+E3ab7wUFzNTgntBZncjnwDtauq/ovgHWv/4KAxDV/jDMsVTzUSfDZ9ieqE7cHGTf /Afg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=hVNwPy+gt0SiBgbKa4Ts7rYRXhcnznGYRRNUIY7t1Y0=; b=hezgqSST7F+bX/g0rtvhan1sz/akz8AQaG8hp6Sw22qxLGPzHYOMptqFJrb83ord/u a20EwLfp72Y6Dkw0UI6vfgyRpFUwDeJ7L8wiAGRv9GQ2nMEYYhn551LjH4vaqQMar0cA n1//jVAB/YiS6M/sku4qm1IslrPenxF87//l3psZTT0ayqXDaEKJELJnCLWzwFOgSPBQ KFiI4oqJptDb6oJueHL+ATVu4wUhG8EyBajPTPM0ixlVNhLZ4VpPw+V1EoSE8BbkwIY2 uQnYqjcOYeTNM5jS0jY7phhTYnKzBQ05+8pNSrJQpV/sDyRDOYQxzgbICJxPzUXMiGyH ixzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=VIIzrxvQ; 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 f207si3688536oib.65.2020.04.03.04.50.28; Fri, 03 Apr 2020 04:50: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; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=VIIzrxvQ; 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 S2390845AbgDCLtF (ORCPT + 99 others); Fri, 3 Apr 2020 07:49:05 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:42029 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728012AbgDCLtE (ORCPT ); Fri, 3 Apr 2020 07:49:04 -0400 Received: by mail-ed1-f67.google.com with SMTP id cw6so8887988edb.9 for ; Fri, 03 Apr 2020 04:49:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=hVNwPy+gt0SiBgbKa4Ts7rYRXhcnznGYRRNUIY7t1Y0=; b=VIIzrxvQDZ7sEKA4V9ATLkkGs8/+gHlbWBKNW4Rd9I1h90LdQgpTL351PKl5//Brw9 Z4DPvYmA0xQ4Pz45YWBOT39ph5ofudPgDnCyMBzS/nygSltVynGbd0xsaf1++4p6dAnG pAJ6fupWjxZ3nh1sBkYj4X8ZY0ChUzUkvCGVA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=hVNwPy+gt0SiBgbKa4Ts7rYRXhcnznGYRRNUIY7t1Y0=; b=ecWqu7IRWoZmuXCJhc9RImM5ZeUCeacu23AdyL2Brw1XdZj/OwDlURLmuSYEPY0lBA l9takNrfNJP54rAs1tbjNCrQ9t3ck2EhAdJzMbKiH/5ZmM27nXUjh1k+fFPT+Rvt6Tou 3iLeemuPd+JKAH7z82Yok1t8LSxWOiPHIRTTxKA1cgNM7LK67j3FWGdSk77pqBsQNf6R RWo4p/vO1nKaZjFmdGUiRiwDoVO+FFYKcrbQb1AZtGN5RYWlzvdI/34y/rG3P5RSKZVI 1Yie0jCJ1zc5Iw6SmpEFKqMwEebYbS1Ls+dLJa99GZCuVQ6e8MNQQl+lGAUkwmDoK8Ac KpYQ== X-Gm-Message-State: AGi0PubgHULkmwRblDpIjzdusDiXda9BqX27HYMmm94akpp8Xu5PMjfF q2dvd9VCoksijhlR86sbpHSb4auAXsJ8Zq1hJvuPWg== X-Received: by 2002:a17:907:271a:: with SMTP id w26mr8098956ejk.195.1585914542881; Fri, 03 Apr 2020 04:49:02 -0700 (PDT) MIME-Version: 1.0 References: <2590640.1585757211@warthog.procyon.org.uk> <36e45eae8ad78f7b8889d9d03b8846e78d735d28.camel@themaw.net> <20200402143623.GB31529@gardel-login> <20200402152831.GA31612@gardel-login> <20200402155020.GA31715@gardel-login> <20200403110842.GA34663@gardel-login> In-Reply-To: <20200403110842.GA34663@gardel-login> From: Miklos Szeredi Date: Fri, 3 Apr 2020 13:48:51 +0200 Message-ID: Subject: Re: Upcoming: Notifications, FS notifications and fsinfo() To: Lennart Poettering 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 3, 2020 at 1:08 PM Lennart Poettering wr= ote: > > 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 somethin= g > > > > > 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, =E2=80=A6 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 I think that should guarantee that all super blocks have been shut down. A= l? The advantage would be that there's no need to walk the mount tree unmounting individual leafs, since it's all done automagically. Thanks, Miklos