linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Drake <dsd@laptop.org>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: Remount root RO after the root dentry drops from the namespace
Date: Wed, 18 Nov 2009 12:38:32 +0000	[thread overview]
Message-ID: <1258547912.2761.46.camel@localhost.localdomain> (raw)
In-Reply-To: <E1NAj3p-0005Mt-E0@pomaz-ex.szeredi.hu>

On Wed, 2009-11-18 at 12:50 +0100, Miklos Szeredi wrote:
> You can easily make a directory a root of a mount with
> 
>  mount --bind $DIR $DIR
> 
> In your example, add this before 5.

Thanks for the suggestion! And following on from that, we would do
"mount -o remount,ro /path/to/realroot" during shutdown
where /path/to/realroot is the bind mount that we created based on your
advice?

Unfortunately, that approach doesn't solve the problem. If you remount a
bind-mount as read only then the "real" underlying mount is unaffected.
See the code flow in do_remount() :

	if (flags & MS_BIND)
		err = change_mount_flags(path->mnt, flags);
	else
		err = do_remount_sb(sb, flags, data, 0);

Any other ideas?

Thanks,
Daniel



  reply	other threads:[~2009-11-18 12:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-18 11:12 Remount root RO after the root dentry drops from the namespace Daniel Drake
2009-11-18 11:50 ` Miklos Szeredi
2009-11-18 12:38   ` Daniel Drake [this message]
2009-11-18 12:58     ` Miklos Szeredi
2009-11-18 14:52       ` Karel Zak
2009-11-18 15:28         ` Miklos Szeredi
2009-11-18 17:08           ` Karel Zak
2009-11-18 17:38             ` Miklos Szeredi
2009-11-18 15:18       ` Daniel Drake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1258547912.2761.46.camel@localhost.localdomain \
    --to=dsd@laptop.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).