From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Williams Subject: [RFC PATCH] touch_mnt_namespace when the mount flags change Date: Fri, 26 Sep 2008 19:01:20 -0700 Message-ID: <20080927015935.5019.83697.stgit@vmware-fedora> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: neilb@suse.de, kay.sievers@vrfy.org, linux-fsdevel@vger.kernel.org To: viro@zeniv.linux.org.uk Return-path: Received: from wx-out-0506.google.com ([66.249.82.234]:9484 "EHLO wx-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752912AbYI0Tyk (ORCPT ); Sat, 27 Sep 2008 15:54:40 -0400 Received: by wx-out-0506.google.com with SMTP id h27so332682wxd.4 for ; Sat, 27 Sep 2008 12:54:39 -0700 (PDT) Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Daemons that need to be launched while the rootfs is read-only can now poll /proc/mounts to be notified when their O_RDWR requests may no longer end in EROFS. Cc: Kay Sievers Cc: Neil Brown Signed-off-by: Dan Williams --- This change is prompted by mdmon which is a userspace metadata handler for software-raid arrays. It will use this notification to drop a communication socket and pidfile on a raid-rootfs once it becomes writable. fs/namespace.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/fs/namespace.c b/fs/namespace.c index 6e283c9..1bd5ba2 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -1553,8 +1553,13 @@ static noinline int do_remount(struct nameidata *nd, int flags, int mnt_flags, if (!err) nd->path.mnt->mnt_flags = mnt_flags; up_write(&sb->s_umount); - if (!err) + if (!err) { security_sb_post_remount(nd->path.mnt, flags, data); + + spin_lock(&vfsmount_lock); + touch_mnt_namespace(nd->path.mnt->mnt_ns); + spin_unlock(&vfsmount_lock); + } return err; }