Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp432883ybk; Fri, 15 May 2020 04:42:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyExJDyw2Uvb41EcgeZfxSvyJss+rtShcRei/LIk0NdXX1xjdY+PnQ93nv1wehXcQYI/ki9 X-Received: by 2002:aa7:d54c:: with SMTP id u12mr2283953edr.298.1589542945839; Fri, 15 May 2020 04:42:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589542945; cv=none; d=google.com; s=arc-20160816; b=h62MuN6bGMw8vM9qAZdtYLF5nNur2LHbSzc35RBf8vf6FuGG4F7FrCCAIaMaEcIjsx sDmPdqS904+rQyb5KmZ6nvlXfMO1JPxpp8UvU8O+rAWPtjUl6q8BxgptW7aOrXaq6T04 B9EyPoBJYAFNpXM1ZNGP6thpF7kMW0oz67EvnDvV/cUXubkwPPEryAGXQ3yk2Bih73N6 LhEeEDcXKduqXuxOWmJrn5ZuXHgWLpqNrncYt3Z30+B8+EHFJCt7Xcrs90RnfJDcAwZG uh/9hDrlH+yLSjJcBAN/gKVB/t1+dplccPDK0WHFBCsQdexkZsnC0kvvgymUUraFvxjf Obfw== 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:reply-to:mime-version:dkim-signature; bh=vx+rjdJtrqWDo1iVdx81WH5syu+StElM96JO8y30OpU=; b=c/UzkWoXH4KSoOeyiS84m+NM2OZ+1fXZn03nwXX1UYI0aCXrcMTiPod20/QP+EkCsc /+CNZNcSGYyDa62Fci0DoOawH+j+od2mr5eEdzV3o00ZOyboY7hjsBv8ThDv9c4q8LZK pxDzzvccWfAT6iQuzTn18RtJtZbRuIXNcxGtPyyoOcFmcz3grtvcoHlZRGvDnoP6KP+j WhOg8C6qSZ9OehhZFsPiGS/zJ196OHG80jfrgzf+b9UUcqWUJcw0cRQlUbrJAdQaG3MK x4r6nLPOePvmqFDDIvSsJ9aop2cge46bdskBU35q7GePo/hnpmDSyQjJHNnQ7TV826qI aF1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WPgjtmvu; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o11si1044867ejr.300.2020.05.15.04.42.01; Fri, 15 May 2020 04:42:25 -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=@gmail.com header.s=20161025 header.b=WPgjtmvu; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726140AbgEOLk1 (ORCPT + 99 others); Fri, 15 May 2020 07:40:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726003AbgEOLk1 (ORCPT ); Fri, 15 May 2020 07:40:27 -0400 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A090DC061A0C; Fri, 15 May 2020 04:40:26 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id d7so1379809eja.7; Fri, 15 May 2020 04:40:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:reply-to:from:date:message-id:subject:to:cc :content-transfer-encoding; bh=vx+rjdJtrqWDo1iVdx81WH5syu+StElM96JO8y30OpU=; b=WPgjtmvuU+9RwoLj/n0H1YhScjg1h4Hgu330I4kqOUDcfeSuQOZKl+5ux8rbb0A1+r 7ELm48Nk8g4Iq8itsNp7nRoCsTlAKAoHnK2ah+xePeZp2pK0stb6n4zW7y9MitNbYdDS bNg0TemLo6X1Wgm4LbjMS91beAkfCoPyvVNVG0xkHsjsU38LIBSiNPr88k5yhaJMl2mH 5eqEVtZV3131W/HDvA1aAfjmoreTAFOE/V6gi/szPbw3TsONPhAJeXwsxwdtqP1sG/pY Ej20wI+N6z6ZiALRxth0w2i3BmnjBrdrQ0f5/Jd0EBrHTFEvOrXEbpUpoKxv8TREGGdn cagQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=vx+rjdJtrqWDo1iVdx81WH5syu+StElM96JO8y30OpU=; b=HZGYHONT4WO708GtyeZN6eKcpcXCGLpq6LXJk/r5n0iKT14Quw1CzxtpW9ElCZ4/95 IBS7ZMKrLSPYjFOJPRsAk/M7EAmhe+L8tZdELGkjDLQLFN1w0VoQCnBM+oKFeUAWpV7L 9YLUqQ4VB8IVq4puPqIXIppH2SPAPTMIlIWNnw7fA4AkQwUBDm2SsnzOBJ4N4IcQoWMI CwTisAzrKa3B8c+vv6LYPrBS5t9fkB+r9DU8pZnEnwtkqCUfhA7/Ah340bfHlMQb3lpT hdh7+5Dg3Ht6wc8PqxNTMiszU5SkWwlSqTWCYL6rox8ZF4qN6TUe1ujis7dbz+0T8PL+ rx9Q== X-Gm-Message-State: AOAM531nfBhkprFPJojQTX+spcT+vp+o+jJJmf5VO7UBQOld7Q56Hbsd Dd8u/0sgSIXINyysxgs17Wh0U8H/z5Q/A/phfPA= X-Received: by 2002:a17:906:add7:: with SMTP id lb23mr2366474ejb.6.1589542825282; Fri, 15 May 2020 04:40:25 -0700 (PDT) MIME-Version: 1.0 Reply-To: mtk.manpages@gmail.com From: "Michael Kerrisk (man-pages)" Date: Fri, 15 May 2020 13:40:14 +0200 Message-ID: Subject: Setting mount propagation type in new mount API To: David Howells , Miklos Szeredi Cc: lkml , "linux-fsdevel@vger.kernel.org" , Petr Vorel , Michael Kerrisk , linux-man 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 Hello David, Miklos, I've been looking at the new mount API (fsopen(), fsconfig(), fsmount(), move_mount(), etc.) and among the details that remain mysterious to me is this: how does one set the propagation type (private/shared/slave/unbindable) of a new mount and change the propagation type of an existing mount? I've looked at the kernel source for a bit, and did not see how this is possible. The draft manual pages sent out a few months ago provide little clue, with the only hint being in the draft fsopen(2) page, which says of fsmount(): fsmount() takes the file descriptor returned by fsopen() and cre=E2= =80=90 ates a mount object for the filesystem root specified there. The attributes of the mount object are set from the mount_attrs param=E2= =80=90 eter. The attributes specify the propagation and mount restric=E2= =80=90 tions to be applied to accesses through this mount. However, that text appears *not* to be true. The 'mount_attrs' argument of fsmount() does not seem to permit specification of propagation type, since in the kernel there is this check: if (attr_flags & ~(MOUNT_ATTR_RDONLY | MOUNT_ATTR_NOSUID | MOUNT_ATTR_NODEV | MOUNT_ATTR_NOEXEC | MOUNT_ATTR__ATIME | MOUNT_ATTR_NODIRATIME)) return -EINVAL; Thanks, Michael --=20 Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/