Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1051229imm; Thu, 31 May 2018 14:21:40 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ7iIp0IHCJ4wwf0pu7OhEuSv1/RoZ/luHoIN3ZfSm+ofH9dD8219O2gqG/PLiX1OlWz2Ds X-Received: by 2002:a63:18c:: with SMTP id 134-v6mr6693447pgb.138.1527801700362; Thu, 31 May 2018 14:21:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527801700; cv=none; d=google.com; s=arc-20160816; b=vpmPH/bNnImHq/Auzu78jsZUTk/esPMWgX+vIznGZiuv4QCXpvwiefUXMNyGTpy5Ej cf8d70JMsJ8ZbZk2Km/y4BFunCDeo/QrQx4c//fECmvEe+DFYvTuI2+1st4yuHsYPM1Z I3jeq+B6lnjdZparvQz1SZkqMfDgC+Noo12b8fDpD9vG+MPaqcbxayzQt/OApuJwteqo pL/O1Ln5znHqU0COky0OmBRfg/0XGqPsRo6WDkewueQTDkooJL09hObv9ywNMuytBF0r 0jXCDTNKB96ZpbdDKQJLOeHUItgJ0jxS3SZ5vwPeoRykhCbruTUDdIl4bt1UH8naGkB0 kJjw== 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:arc-authentication-results; bh=CiVr/cZD5aVnptyYt1Tr4/DN4aCBXkAjoeCKIGbzR90=; b=mn6EXvXKLT7Y8UzHChLewBKfQc4gAWAI9p4yTke7oxZQnd/ncyoT0r7q8C5svp+pZe MweYLWaNvW/Da4C1s2DUZOwnTrXLXGBGZxIz6KTjCvnAyxSf7mMhkzH4Zab1tUNeiFRP upm8GqyUl8cQGQAwYB7HDUb0oGGaa5p8ynprVkVDgCnL3R2VMIo+39cWHFZdUXCTbrB0 nwQtvWAzngIWPOBChgayM0ATj0KnDKuphJzBmNQsdibz9F71kW94+fWIWUhmVuHA/CVU BFpgZIPsBmzVw+OrqHKPKLsG4aQQjXoDz4EUU5UO76zpX/WngiR2+BKYK+RuHwg+ZECh /3uA== 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 k6-v6si2397453pgk.256.2018.05.31.14.21.25; Thu, 31 May 2018 14:21: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; 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 S1751305AbeEaVUy (ORCPT + 99 others); Thu, 31 May 2018 17:20:54 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:51000 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750941AbeEaVUt (ORCPT ); Thu, 31 May 2018 17:20:49 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1fOV04-0008PM-Ja; Thu, 31 May 2018 21:20:48 +0000 Date: Thu, 31 May 2018 22:20:48 +0100 From: Al Viro To: David Howells Cc: linux-fsdevel@vger.kernel.org, linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 31/32] [RFC] fs: Add a move_mount() system call [ver #8] Message-ID: <20180531212048.GJ30522@ZenIV.linux.org.uk> References: <152720672288.9073.9868393448836301272.stgit@warthog.procyon.org.uk> <152720692470.9073.11301353609129445901.stgit@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <152720692470.9073.11301353609129445901.stgit@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 Fri, May 25, 2018 at 01:08:44AM +0100, David Howells wrote: > [!] NOTE: This patch doesn't quite work to move an O_CLONE_MOUNT-produced > vfsmount as move_mount() checks that the source vfsmount mnt_ns matches > the calling process's mnt_ns - but the vfsmount's mnt_ns isn't set > until one attempts to actually mount it into the namespace. *shrug* Turn those checks into error = -EINVAL; /* mountpoint should be ours */ if (!check_mnt(p)) goto out1; /* and the thing moved should be either ours or completely unattached */ if (old->mnt_ns && !check_mnt(old)) goto out1;