Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3305132pxf; Mon, 15 Mar 2021 06:45:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAGP/iqLltebuLdFKNk+nDfA4XSDjC8zoxiYjKLNo797Ps3DuSM1sbKeipiZPLqtY95mFg X-Received: by 2002:a17:907:7699:: with SMTP id jv25mr22287995ejc.363.1615815933882; Mon, 15 Mar 2021 06:45:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615815933; cv=none; d=google.com; s=arc-20160816; b=jcaf/VtUD8dvmUbM+SGxDMAsOH0ZruCWuxKkELwtjClJ7hG3bMqiXUxJrgVJehr0L8 SCt1jZnYIbimEvQ/NKXZqKWSJW9K7fOdy//TDQEA0ASuxcrolLSd+i1nA0gPAss4Dglz chTrltExx6uMP5HDT6FTnvUlURwcReTpvLcum1vWcWCa4PgrrvpayKrV7cZf2Kwtux7m jmKzlpWpveTuvNMuVC28pF+Ys3LPwGk3OfoklBDVo2/5HwtE6X7omDiyqj4v1yToAuBX kroUmJJYgl9K9970wfzjfhWbI7XbdwZZAqyyk+I1ovxUrTw0rZ7sXrFd0WhTzGk3MLq9 p+sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-id:mime-version:subject :cc:to:references:in-reply-to:from:organization:dkim-signature; bh=pIaBmIY3wpgp8eqLpLPVRWAADavoCBIo1W8aCkerR6M=; b=GYt4k+0uRuOOCQ0DmaUr+dcIZ7pL2Q8BcBbZh53DkVDyuQd5IOUX0ByB4JlFWNDgGl Cp7wvxHp09wCGMZZe2LOxXtuqrJKnRtgMqszA5CHZDx4KoYO8DMZHfvCTllZr08IgKWI mJefQeF4jdCZuKSAsHAHjEkHXAEplACKLzxFpGN3vxT5nm1ETtkbTqeJ3nXCBpIEmCie PV+a/f59gmb2oLygxUVMTP+r+9uf9Zleekrs+d2qmV8AQc4GrbIyNQKZnRlXd/9afvcv Jm4xMuLAmo+1E7evKHgrVBLvFFINIAr5QAYYhv+IrpsRfn3NKkH/iOEFk6c3r1mOfwbO LdVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="IBa+/4uC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jz18si10568907ejc.575.2021.03.15.06.45.11; Mon, 15 Mar 2021 06:45:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="IBa+/4uC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229817AbhCONmM (ORCPT + 99 others); Mon, 15 Mar 2021 09:42:12 -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