From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752745AbbC0Wfg (ORCPT ); Fri, 27 Mar 2015 18:35:36 -0400 Received: from mail-lb0-f181.google.com ([209.85.217.181]:33063 "EHLO mail-lb0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751400AbbC0Wfe (ORCPT ); Fri, 27 Mar 2015 18:35:34 -0400 MIME-Version: 1.0 In-Reply-To: References: <1427488774-5077-1-git-send-email-avagin@openvz.org> Date: Sat, 28 Mar 2015 01:35:32 +0300 Message-ID: Subject: Re: [PATCH] fs: show locked and lock_ro options in mountinfo From: Andrey Wagin To: Richard Weinberger Cc: linux-fsdevel , LKML , Cyrill Gorcunov , Pavel Emelyanov , "Eric W. Biederman" , Alexander Viro Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2015-03-28 0:42 GMT+03:00 Richard Weinberger : > On Fri, Mar 27, 2015 at 9:39 PM, Andrey Vagin wrote: >> I don't see any reasons to hide them. This information can help to >> understand errors. > > Because these flags are set/read only internally by the VFS. In contrast > to the other flags shown by mountinfo MNT_LOCKED is not a mount option. But this flag is set as a result of the specified user action, when he unshares userns and mntns. This flag affects visiable behaviour. > > Why does it help to debug errors? > How would a user know that mount() with MS_BIND returns EINVAL because > the mount source is MNT_LOCKED? This information is useless for her. If I see lock_ro, I can be sure that mount -o remount,bind,rw /XXX will fail. If I see locked, I know that this mount can't be umounted or moved and can be bind-mounted only recursively. If a user see these flags, he can check that a mount namespace is configured correctly without security issues. Sorry but I don't understand why you think that this information is useless for users. > If you argue like that you'd have to expose the whole VFS state to userland. I have not noticed other MNT_LOCK_* flags. I should think more about what information are a really required for dumping mount namespaces. > >> And this information is required for correct checkpoint/restore of mount >> namespaces. > > Why especially MNT_LOCKED and not all the other flags used by VFS? My goal is to dump enough information about a mount namespace to be able to restore it back later. I don't know how to do this without knowledge about locked mounts. I will think. > Say MNT_DOOMED? Mounts with MNT_DOOMED are never shown in mountinfo, are they? Thank you for looking at this patch. > > -- > Thanks, > //richard