Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1588455imm; Fri, 12 Oct 2018 23:07:28 -0700 (PDT) X-Google-Smtp-Source: ACcGV61G9sQYkNU8W2GLU+tRt85b/8YqjSsdccB9DwA6WNESRBsFVtdqQZlnuFjeWo3HzK38Edy1 X-Received: by 2002:a63:5153:: with SMTP id r19-v6mr8321235pgl.419.1539410848039; Fri, 12 Oct 2018 23:07:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539410848; cv=none; d=google.com; s=arc-20160816; b=kchJGNGbohBZ55Bl3GiojJ0EFcjB/tHpT911Euf2BBfa6KmckxHwYCQy5anc6vJI0B O5/x0Bo0botVndv019oJhKlUqD80qg5/vThLEBQt4S5e1CPE1v4094nN9PRApcghTZz2 f3y4aSn0KIOVoahbElUwDUuOz3nM0prl/h4gbFQ2HoWiLcrzK/+GH37hXqYPZYtceTKG rJ6vNGc4R3UzY6rq0nNg+dnC8zEvUp9QQKd5UEPmGyH3YocJFeMIP4J8nhlUSgbBejl9 bJtOfLOknUWXkOwRnjSNHUHU6oM5myL2RCBqMAaPJKdk9uI30uwec0jcakkiNBfRHExR s18w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=mBy0Q3ZRAF0bosHD4YX3o+oxJ+pam0foEDSEejLO9lk=; b=f4Kjm9tQ/ecRIpO0GAfLohzdmLBe56asy6z7ZkEZm7LVhoKHRqVUJg4oQEbyK7ZQqw /i2va1XFfDFkqmempikTgo1pPxiNbXXuxcBm5jwldVMlFGdcnYYX+tH+lt1jbFjIJcja p3bH6/Ygo/OQmEz+vrbP7jmHlXKv+aZc6Udf70gSEkK/LtnXJvjtO9J+KVj1CIMQoJCj nftBLg1yisfVFqOAhZU/byUntLGDPgbQQCf0029qsk98i/5iCsCrJoiEgYxm68+m/vqp k1yypDmqelhwFnlRAMmClj+WMquiPDeIWKz5+tPVvYKGtfnxgnNLmdqcOF3bUttqZnHZ C2vw== 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 1-v6si3673474plr.72.2018.10.12.23.07.12; Fri, 12 Oct 2018 23:07:28 -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 S1726512AbeJMNmQ (ORCPT + 99 others); Sat, 13 Oct 2018 09:42:16 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:46706 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726054AbeJMNmQ (ORCPT ); Sat, 13 Oct 2018 09:42:16 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gBD47-0003iJ-4q; Sat, 13 Oct 2018 06:06:19 +0000 Date: Sat, 13 Oct 2018 07:06:19 +0100 From: Al Viro To: David Howells Cc: "Eric W. Biederman" , Alan Jenkins , torvalds@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, mszeredi@redhat.com Subject: Re: [PATCH 03/34] teach move_mount(2) to work with OPEN_TREE_CLONE [ver #12] Message-ID: <20181013060618.GQ32577@ZenIV.linux.org.uk> References: <87sh1cqqfs.fsf@xmission.com> <5c6f3d62-4cec-2aea-4693-62928611c526@gmail.com> <153754740781.17872.7869536526927736855.stgit@warthog.procyon.org.uk> <153754743491.17872.12115848333103740766.stgit@warthog.procyon.org.uk> <862e36a2-2a6f-4e26-3228-8cab4b4cf230@gmail.com> <17405.1539272035@warthog.procyon.org.uk> <15324.1539289074@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15324.1539289074@warthog.procyon.org.uk> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 11, 2018 at 09:17:54PM +0100, David Howells wrote: > +/* > + * Object if there are any nsfs mounts in the specified subtree. These can act > + * as pins for mount namespaces that aren't checked by the mount-cycle checking > + * code, thereby allowing cycles to be made. > + */ > +static bool check_for_nsfs_mounts(struct mount *subtree) > +{ > + struct mount *p; > + bool ret = false; > + > + lock_mount_hash(); > + for (p = subtree; p; p = next_mnt(p, subtree)) > + if (mnt_ns_loop(p->mnt.mnt_root)) > + goto out; > + > + ret = true; > +out: > + unlock_mount_hash(); > + return ret; > +} Umm... The comment doesn't match the behaviour - you are accepting references to later namespaces. Behaviour is not a problem, the comment is.