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)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 20 Nov 2008 22:54:41 +0000 (14:54 -0800)
commit 0e55a7cca4b66f625d67b292f80b6a976e77c51b upstream

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/namespace.c

index 6e283c93b50dad95a723633b8f257c6d7dccefb7..1bd5ba20a4316fbf108c82ca46c9d94926318774 100644 (file)
@@ -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;
 }