From patchwork Fri Apr 13 16:11:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Brauner X-Patchwork-Id: 10340401 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9EEA56039A for ; Fri, 13 Apr 2018 16:13:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A68528915 for ; Fri, 13 Apr 2018 16:13:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F4EE2891C; Fri, 13 Apr 2018 16:13:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 29FCD28915 for ; Fri, 13 Apr 2018 16:13:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752920AbeDMQMt (ORCPT ); Fri, 13 Apr 2018 12:12:49 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:45542 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750960AbeDMQLu (ORCPT ); Fri, 13 Apr 2018 12:11:50 -0400 Received: by mail-wr0-f193.google.com with SMTP id u11so9475652wri.12; Fri, 13 Apr 2018 09:11:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bQMLvV0Ko6+62/3QhUYTnjSM6q/HltMW5KN/AdFhXts=; b=FzCIZXIC/EzPODd5o8UikdVTLdOnGgaSdFMSsfkMH/nFkCfe1qHeC6OH0jOAJcQ3UI WQdP/bBerRm6F5fYOrU8eXU+nmv7kPwMmKipgs+xLShBbVqLsbHfbCU00wrzd29eXU7K QmfKBwdLbQpeIPz/JBi5u8/iLNYA+SYWmgZOoCgjduw6buOUq4GY48c88XRtyx4xx9dc bFGmggsh3xJ+FGlpOpu6aov7sfh67wnzpC62mHj2cMPy2s6LF2v+JDxwB47Z3wldF2gV OAnMJSIn51eZ3I923JV49UMQVn78vByfTMN5jz4h6e4MkvxqI6eXGe5dOdcj7Anxqo5T w7nQ== X-Gm-Message-State: ALQs6tABk180xH90Y5YOl3WkgYfs33nhfpRePj0mfAaMyJkqm19x/oRp QtOb1vNMpmy3iomTVmj2Hjs= X-Google-Smtp-Source: AIpwx4/XJ6kJIfELH2P0ZHf95DSkvVXLVRh+YyxgKwrEdx/NoaRera0z8SSd0qEb46uEW+YA3tT64w== X-Received: by 10.28.125.88 with SMTP id y85mr356875wmc.95.1523635908909; Fri, 13 Apr 2018 09:11:48 -0700 (PDT) Received: from localhost.localdomain (u-086-c117.eap.uni-tuebingen.de. [134.2.86.117]) by smtp.gmail.com with ESMTPSA id k35sm5371772wre.55.2018.04.13.09.11.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Apr 2018 09:11:48 -0700 (PDT) From: Christian Brauner To: viro@zeniv.linux.org.uk, tglx@linutronix.de, kstewart@linuxfoundation.org, gregkh@linuxfoundation.org, pombredanne@nexb.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, serge@hallyn.com Cc: Christian Brauner Subject: [PATCH 3/6] statfs: add ST_UNBINDABLE Date: Fri, 13 Apr 2018 18:11:23 +0200 Message-Id: <20180413161126.31313-4-christian.brauner@ubuntu.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180413161126.31313-1-christian.brauner@ubuntu.com> References: <20180413161126.31313-1-christian.brauner@ubuntu.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This lets userspace query whether a mountpoint was made MS_UNBINDABLE. Signed-off-by: Christian Brauner --- fs/statfs.c | 2 ++ include/linux/statfs.h | 1 + 2 files changed, 3 insertions(+) diff --git a/fs/statfs.c b/fs/statfs.c index 5b2a24f0f263..61b3063d3921 100644 --- a/fs/statfs.c +++ b/fs/statfs.c @@ -29,6 +29,8 @@ static int flags_by_mnt(int mnt_flags) flags |= ST_NODIRATIME; if (mnt_flags & MNT_RELATIME) flags |= ST_RELATIME; + if (mnt_flags & MNT_UNBINDABLE) + flags |= ST_UNBINDABLE; return flags; } diff --git a/include/linux/statfs.h b/include/linux/statfs.h index b336c04e793c..e1b84d0388c1 100644 --- a/include/linux/statfs.h +++ b/include/linux/statfs.h @@ -40,5 +40,6 @@ struct kstatfs { #define ST_NOATIME (1<<10) /* do not update access times */ #define ST_NODIRATIME (1<<11) /* do not update directory access times */ #define ST_RELATIME (1<<12) /* update atime relative to mtime/ctime */ +#define ST_UNBINDABLE (1<<17) /* change to unbindable */ #endif