[RFC PATCH] touch_mnt_namespace when the mount flags change
authorDan Williams <dan.j.williams@intel.com>
Sat, 27 Sep 2008 02:01:20 +0000 (19:01 -0700)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 23 Oct 2008 09:13:23 +0000 (05:13 -0400)
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 <kay.sievers@vrfy.org>
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
fs/namespace.c

index f527a0d6c64d1392533593c3abaf18722f7e2fa7..cce46702d33c98f6d9e1669ac10f4d6c23be82c2 100644 (file)
@@ -1550,8 +1550,13 @@ static int do_remount(struct path *path, int flags, int mnt_flags,
        if (!err)
                path->mnt->mnt_flags = mnt_flags;
        up_write(&sb->s_umount);
-       if (!err)
+       if (!err) {
                security_sb_post_remount(path->mnt, flags, data);
+
+               spin_lock(&vfsmount_lock);
+               touch_mnt_namespace(path->mnt->mnt_ns);
+               spin_unlock(&vfsmount_lock);
+       }
        return err;
 }