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 X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B849C433E6 for ; Mon, 15 Mar 2021 13:42:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D3A0364EEE for ; Mon, 15 Mar 2021 13:42:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229805AbhCONmN (ORCPT ); Mon, 15 Mar 2021 09:42:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:50699 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229713AbhCONl5 (ORCPT ); Mon, 15 Mar 2021 09:41:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615815717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=pIaBmIY3wpgp8eqLpLPVRWAADavoCBIo1W8aCkerR6M=; b=IBa+/4uC/qUAayvMuH8AIe9TAogkwTwhK5zxBoQzOEsbpRQhs2/w0Md6Jis4rjDumKdODM npyL1AwWt1YRQAU6DaHhB7eB+RFGSNwipIW94TwvYlPLSU1mEs+q60A7SPaiL87V201p8D eyhuozeVJACBoYJESxUvcYJOuiAPHbQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-439-aHkpMn5yMBmMROU_HtnydA-1; Mon, 15 Mar 2021 09:41:53 -0400 X-MC-Unique: aHkpMn5yMBmMROU_HtnydA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6C08380006E; Mon, 15 Mar 2021 13:41:51 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-118-152.rdu2.redhat.com [10.10.118.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id E8E19620DE; Mon, 15 Mar 2021 13:41:49 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <161581005972.2850696.12854461380574304411.stgit@warthog.procyon.org.uk> To: Miklos Szeredi Cc: dhowells@redhat.com, Alexander Viro , Matthew Wilcox , Ian Kent , Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC][PATCH 0/3] vfs: Use an xarray instead of inserted bookmarks to scan mount list MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2857439.1615815708.1@warthog.procyon.org.uk> Date: Mon, 15 Mar 2021 13:41:48 +0000 Message-ID: <2857440.1615815708@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Miklos Szeredi wrote: > > (2) We can use the file position to represent the mnt_id and can jump to > > it directly - ie. using seek() to jump to a mount object by its ID. > > What happens if the mount at the current position is removed? umount_tree() requires the namespace_sem to be writelocked, so that should be fine as the patches currently read-lock that whilst doing /proc/*/mount* I'm assuming that kern_unmount() won't be a problem as it is there to deal with mounts made by kern_mount() which don't get added to the mount list (mnt_ns is MNT_NS_INTERNAL). kern_unmount_array() seems to be the same because overlayfs gives it mounts generated by clone_private_mount(). It might be worth putting a WARN_ON() in kern_unmount() to require this. When reading through proc, m_start() calls xas_find() which returns the entry at the starting index or, if not present, the next higher entry. David